Saeid Kdaimati
Top achievements
Rank 2
Saeid Kdaimati
asked on 13 Mar 2013, 02:07 PM
Hi,
Just trying to set the selected value of combobox in code behind, but it is not working out:
The stored procedure I'm calling return correct data.
Any help??
Just trying to set the selected value of combobox in code behind, but it is not working out:
RadComboBox1.DataSource = ds.Tables[0];
RadComboBox1.DataTextField =
"Text"
;
RadComboBox1.DataValueField =
"ID"
;
RadComboBox1.DataBind();
if
(ds.Tables[1].Rows.Count > 0)
{
RadComboBox1.SelectedValue = ds.Tables[1].Rows[0][
"ID"
].ToString();
}
The stored procedure I'm calling return correct data.
Any help??
4 Answers, 1 is accepted
0
Hi Saeid,
The code you posted seems to be correct. Please check returned data from the Stored Procedure once again. I'm attaching a small sample demonstrating how this code works as expected.
All the best,
Hristo Valyavicharski
the Telerik team
The code you posted seems to be correct. Please check returned data from the Stored Procedure once again. I'm attaching a small sample demonstrating how this code works as expected.
All the best,
Hristo Valyavicharski
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Dev
Top achievements
Rank 1
answered on 13 Mar 2013, 05:23 PM
If you take your example and use Tools -> Generate Local Resource on Default.aspx in design view, SelectedValue has no effect and a blank selection is added at the top of the ComboBox.
0
Hello,
Thank you for pointing this out. This is a development issue, which I have logged for further investigation.
Regards,
Hristo Valyavicharski
the Telerik team
Thank you for pointing this out. This is a development issue, which I have logged for further investigation.
Regards,
Hristo Valyavicharski
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Hi Rob,
The issue with the creation of the default item when local resources are created will be resolved in Q2.2013 SP1.
Regards,
Peter Filipov
Telerik
The issue with the creation of the default item when local resources are created will be resolved in Q2.2013 SP1.
Regards,
Peter Filipov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.