4 Answers, 1 is accepted
0
Cori
Top achievements
Rank 2
answered on 24 Sep 2010, 02:37 PM
Can you show us what your RadComboBox declaration looks like?
0
Leszek
Top achievements
Rank 1
answered on 30 Sep 2010, 05:41 PM
sorry for delay. I was on the trip.
thanks
Leszek
<telerik:RadComboBox ID="RadCBProducts" Runat="server" AutoPostBack="true" DataSourceID="LinqDSProducts" DataTextField="ProductName" DataValueField="IdProduct" Skin="Sunset" EnableLoadOnDemand="false"> </telerik:RadComboBox>
protected void Page_Load(object sender, EventArgs e) { LinqDSPrices.Where = "Idproduct==" + RadCBProducts.SelectedValue;// this value is "" RadGrid1.DataBind(); RadGrid1.Rebind(); }Leszek
0
Accepted
Cori
Top achievements
Rank 2
answered on 30 Sep 2010, 07:37 PM
Hello Leszek,
Change your code to this:
You need to bind the RadComboBox when accessing it in the Page_Load event because it has not be data bound yet. Thus, the reason why SelectedValue is blank.
I hope that helps.
Change your code to this:
RadCBProducts.DataBind(); LinqDSPrices.Where = "Idproduct==" + RadCBProducts.SelectedValue;// this value is "" RadGrid1.DataBind(); RadGrid1.Rebind();You need to bind the RadComboBox when accessing it in the Page_Load event because it has not be data bound yet. Thus, the reason why SelectedValue is blank.
I hope that helps.
0
Leszek
Top achievements
Rank 1
answered on 30 Sep 2010, 08:03 PM
it is working now.
Thanks.
Leszek
Thanks.
Leszek