Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
640
How to Call Validating Event in Button Click Event
posted

Hi Everyone 

How to fire a Ultratextbox validating event in Ultrabutton Click event. I tried it usually like these following two methods both throws same errors like this

Method 1:

private void uiButton1_Click(object sender, EventArgs e)

{

uiTextBox_Validating(this, CancelEventArgs.Empty);

}

Method 2:

private void uiButton1_Click(object sender, EventArgs e)

{

uiTextBox_Validating(this, e);

}

It throws some errors like

Error 2 The best overloaded method match for 'Task_2_Control_Panel.FrmControlPanel.uiTextbox_Validating(object, System.ComponentModel.CancelEventArgs)' has some invalid arguments D:\Task 2 Control Panel\Control Panel.cs 1225 13 Task 2 Control Panel

Error 3 Argument '2': cannot convert from 'System.EventArgs' to 'System.ComponentModel.CancelEventArgs' D:\Task 2 Control Panel\Control Panel.cs 1225 44 Task 2 Control Panel

Could anyone help me to sort this issue.

Thanks in advance

Ferdin

Parents
No Data
Reply
  • 5
    posted

    I too had the same problem when I tried to fire a validating event within a ButtonClick event.I went through the reply answer to ur post.But answer is not clear to me as well

    ferdin said:

    Hi Everyone 

    How to fire a Ultratextbox validating event in Ultrabutton Click event. I tried it usually like these following two methods both throws same errors like this

    Method 1:

    private void uiButton1_Click(object sender, EventArgs e)

    {

    uiTextBox_Validating(this, CancelEventArgs.Empty);

    }

    Method 2:

    private void uiButton1_Click(object sender, EventArgs e)

    {

    uiTextBox_Validating(this, e);

    }

    It throws some errors like

    Error 2 The best overloaded method match for 'Task_2_Control_Panel.FrmControlPanel.uiTextbox_Validating(object, System.ComponentModel.CancelEventArgs)' has some invalid arguments D:\Task 2 Control Panel\Control Panel.cs 1225 13 Task 2 Control Panel

    Error 3 Argument '2': cannot convert from 'System.EventArgs' to 'System.ComponentModel.CancelEventArgs' D:\Task 2 Control Panel\Control Panel.cs 1225 44 Task 2 Control Panel

    Could anyone help me to sort this issue.

    Thanks in advance

    Ferdin

    ....

     

Children
No Data