3 Answers, 1 is accepted
0
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
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
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:
And the Page_Load() event handler:
Therefore, I used the UserControl in a WebForm and included a RadButton which only function is to trigger a PostBack.
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
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.