RadCombobox

4 posts, 0 answers
  1. Manorath
    Manorath avatar
    2 posts
    Member since:
    Aug 2018

    Posted 21 Aug 2018 Link to this post

         RadCombobox not showing new selected value or item after postback it always showing item selected first time when page load.
  2. Tsvetomir
    Admin
    Tsvetomir avatar
    756 posts

    Posted 21 Aug 2018 Link to this post

    Hi Manorath,

    I created a sample which comprises of a RadComboBox and a RadButton which triggers a PostBack, unfortunately, I could not reproduce this issue on my side.

    Could you elaborate in more details what is your exact scenario. Ideally, if you could modify the sample attached to this sample would help us to provide more accurate answer.

    Looking forward to your reply.

    Kind regards,
    Tsvetomir
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Manorath
    Manorath avatar
    2 posts
    Member since:
    Aug 2018

    Posted 21 Aug 2018 in reply to Tsvetomir Link to this post

    Hello,

    Actually we are creating RadCombobox dynamically using asp.net web user control.

    After postback a new instance of radcombobox is created. Is this might be the issue.Because html is render every time on post back but when i am debugging correct value is set from the controller.

  4. Tsvetomir
    Admin
    Tsvetomir avatar
    756 posts

    Posted 24 Aug 2018 Link to this post

    Hi Manorath,

    I have created a fully runnable sample project following the requirements you have set - create a RadComboBox dynamically in a UserControl. I have created it in the Page_Load() event handler and added it to a div placeholder in the markup as follows:
    <div id="divPlaceHolder" runat="server"></div>

    And the Page_Load() event handler:
    protected void Page_Load(object sender, EventArgs e)
    {
        RadComboBox combo = new RadComboBox();
        combo.DataSource = GetComboSource();
        combo.DataTextField = "ShipName";
        combo.DataValueField = "ShipName";
        combo.DataBind();
     
        divPlaceHolder.Controls.Add(combo);
    }

    Therefore, I used the UserControl in a WebForm and included a RadButton which only function is to trigger a PostBack. 
    <uc:ComboBoxUC ID="ComboBoxUserControl1" runat="server" />
    <telerik:RadButton ID="RadButton1" runat="server" AutoPostBack="true" Text="RadButton"></telerik:RadButton>

    After triggering a PostBack, the lastly selected value in the RadComboBox is saved. 

    Please download and run the sample to ensure that it works as expected. If you are still facing this issue, please modify the provided example and attach it to an official Support Ticket. That would allow us to investigate your exact scenario locally and help you more efficiently. 

    Once we have a solution, we can share it here for convenience and better visibility from the community.

    Kind regards,
    Tsvetomir
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top