We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Call EJDropDownList from codebehind

Dear Syncfusion!


I want to call my EJDropDownList Change event from C# codebehind. 
This event what I want to call:

protected void EJDropDownList_Change(object sender, Syncfusion.JavaScript.Web.DropdownListEventArgs e) {
...
}

EJDropDownList_Change(sender, e); not work with this error:

cannot convert from 'System.EventArgs' to 'SyncFusion.JavaScript.Web.DropDownlistEventArgs'.

Thanks,
 Imre

3 Replies

PO Prince Oliver Syncfusion Team July 24, 2017 09:56 AM UTC

Hi Imre, 

Thank you for using Syncfusion products. 

To call the EJDropDownList Change event from codebehind, you need to define the DropdownListEventArgs and then you can pass it as parameter by setting its value to null. Kindly refer the following code snippet. 

Syncfusion.JavaScript.Web.DropdownListEventArgs args = null; 
EJDropDownList_Change(sender, args); 

We have prepared a sample, kindly refer to the following link for the sample: http://www.syncfusion.com/downloads/support/forum/131663/ze/DdlAspSample-933213496 

Regards, 
Prince 



IR Imre Revesz July 24, 2017 10:57 AM UTC

Hi!


Thanks. It works great.


Regards,

 Imre



PO Prince Oliver Syncfusion Team July 25, 2017 04:03 AM UTC

Hi Imre, 

Most welcome. 

We are glad to help you. 

Regards, 
Prince 


Loader.
Live Chat Icon For mobile
Up arrow icon