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
520
Select all items in DropDown Server Side
posted

How can i select all the items in a webdropdown with server side code ? 

  • 10685
    Offline posted

    I was just wondering did you have a chance to try my suggestion.
    If you still need any assistance on the matter, please do not hesitate to ask.

  • 10685
    Offline posted

    Hello gamerschlag,

    Thank you for posting in our community!

    It is possible to select all of the items from a WebDropDown ServerSide via the following code:

    “Assuming there is a WebDropDown3 already created.”

    protected void Page_Load(object sender, EventArgs e)

        {

            #region Select all items ServerSide

            Infragistics.Web.UI.ListControls.WebDropDown WDD3 = (WebDropDown)FindControl("WebDropDown3");

            DropDownItemCollection Items = WDD3.Items;

            WDD3.EnableMultipleSelection = true;

                 foreach (DropDownItem item in Items)
                {
                    item.Selected = true;

                }
             //Check selected Items
                    List<DropDownItem> AllSelected = WDD3.SelectedItems;

            #endregion

        }