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.
Unfortunately, activation email could not send to your email. Please try again.

Setting selecteditems on serverside

Thread ID:





118700 Apr 1,2015 06:51 AM Apr 3,2015 10:43 AM ASP.NET Web Forms (Classic) 1
Tags: MultiSelectionDropDown
Graham Gardner
Asked On April 1, 2015 06:51 AM

I have a Multiselectiondropdown control binded to a datatable, on the page load I want to be able to pre select values in this control. My code currently seems to do this successfully on the server side however the selecteditems do not appear in the control on the client side. see code snippets below. probably something simple I am not doing but can't see it myself!
following code is in page_load within a if (!Page.IsPostBack) check...

DataTable dtMP = PortalData.GetTableData("tsResults", strFilterCriteria + " GROUP BY TradeSite");
msddfMP.DataSource = dtMP;
msddfMP.DataTextField = "TradeSite";
msddfMP.DataValueField = "TradeSite";
msddfMP.CheckBoxListRepeatColumns = 4;
msddfMP.CheckBoxListRepeatDirection = RepeatDirection.Vertical;
msddfMP.PopupPositionVertical = Syncfusion.Web.UI.WebControls.Shared.PopupPositionVertical.Bottom;
foreach (string theMarketplace in PortalData.getCountryMarketplaces(theFilterValue))
     ListItem theItem = msddfMP.Items.FindByText(theMarketplace);
     if (theItem != null)
         theItem.Selected = true;
UpdatePanel15.Update(); //Display selected trade sites for country
<asp:UpdatePanel ID="UpdatePanel15" runat="server" UpdateMode="Conditional" >
<syncfusion:MultiSelectionDropDown ID="msddfMP"
  TextBoxCssClass="form-control input-sm"
  ButtonCssClass="form-control input-sm"
  ButtonHoverCssClass="form-control input-sm"
  TextBoxHoverCssClass="form-control input-sm"
  runat="server" Width="100%" >
    <asp:AsyncPostBackTrigger ControlID="btnClear" EventName="Click"  />

Ezhil S [Syncfusion]
Replied On April 3, 2015 10:43 AM

Hi Gardner,

Thank you for contacting Syncfusion support.

With reference to the shared code snippet, We are unable to reproduce the reported issue on not displaying the dynamically selected items in MultiSelectDropDown control from code behind. We have prepared sample with the shared code using dummy database and that works fine at our end. Could you please share us defect sample or modify ur sample to issue at our end? So that we can provide you a solution.

We have prepared a simple sample and it can be downloaded from link below:
Please let us know if you have any other queries.

Ezhil S


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.