This is a migrated thread and some comments may be shown as answers.

RadCombobox

3 Answers 44 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Manorath
Top achievements
Rank 1
Manorath asked on 21 Aug 2018, 06:48 AM
     RadCombobox not showing new selected value or item after postback it always showing item selected first time when page load.

3 Answers, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 21 Aug 2018, 11:31 AM
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.
0
Manorath
Top achievements
Rank 1
answered on 21 Aug 2018, 11:36 AM

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.

0
Tsvetomir
Telerik team
answered on 24 Aug 2018, 08:19 AM
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.
Tags
ComboBox
Asked by
Manorath
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Manorath
Top achievements
Rank 1
Share this question
or