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
810
Webdropdown dynamic creation of clientside events
posted

 

 

Hi all,

I have a webdropdown created dynamically.I need to add a clientside event to this and get the values of all selected items in it. How do I do that?I am trying some thing like this.

Infragistics.Web.UI.ListControls.

WebDropDown lb = new Infragistics.Web.UI.ListControls.WebDropDown();

lb.EnableClosingDropDownOnSelect = false;

lb.EnableMultipleSelection = true;

lb.Attributes.Add(

"Selection Changed", "fncSSDDoc(this.value);");

Any code could help.

  • 49378
    Suggested Answer
    posted

    Hi ssvan,

    As far as I can understand, the first thing you are looking for is how to specify the clientside handler for some event. You can do this by using something like:

        WebDropDown1.ClientEvents.SelectionChanged = "MySelectionChangedHandler";

    Regarding your second question - getting the values of the selected items: you could use the following javascript code:

        $find('WebDropDown1').get_selectedItems()

    Afterwards for each individual item you could use the get_value() method to acquire its value.

    Please let me know if this helps.

    Best Regards,

    Petar Ivanov
    Developer Support Engineer
    Infragistics, Inc.
    http://ko.infragistics.com/support