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
245
WebDropDown - Display Selected Value
posted

I have several WebDropDowns on my page.  When the user clicks the dropdown to view the list, I need to display each item's text.  When they select an item, I need to display the selected value, rather than the selected text, as the selected item in the dropdown list.  Is this possible?

Parents
No Data
Reply
  • 10685
    Offline posted

    Hello, 

    If you would like to change only the current value for the drop down to match the selected item’s value, it is possible to handle the client side SelectionChanged event and use the following: 
    function WebDropDown1_SelectionChanged(sender, eventArgs) {

        selItem = sender.get_selectedItem();

        selItemVal = sender.get_selectedItem().get_value();

        //change the selected text

        sender.set_currentValue(selItemVal)
    } 
    <ig:WebDropDown>
    <ClientEvents SelectionChanged="WebDropDown1_SelectionChanged" />
    </ig:WebDropDown> 

    If you would like to manipulate each item’s text and change it upon user interaction with its value, it is possible to add the following in the above event as well
        //change the item's text
              selItem.set_text(selItemVal); 

    Additionally you could reference some of the already existing topics regarding this or similar matters:
    http://es.infragistics.com/community/forums/t/71997.aspx
    http://es.infragistics.com/community/forums/t/65595.aspx
    http://es.infragistics.com/community/forums/t/76242.aspx

Children