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

Error when using two related radcombox box in formview

1 Answer 50 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Doan
Top achievements
Rank 1
Doan asked on 21 May 2014, 03:32 AM
Hi All, I 'm a matter when using RadGrid and radwindow to
insert/update data from database. I used Formview to add data( controls:
textbox, combobox), but i used two related combox in formview to filter
data , i have  error:
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
My codes:
1. combox 1:
<telerik:RadComboBox ID="ddlMaSP" Runat="server" DataSourceID="SqlDsMaSP"

DataTextField="TenSP" DataValueField="MaSP" SelectedValue='<%# Bind("MaSP") %>'

Skin="Office2007" Width ="300px">

</telerik:RadComboBox>

<asp:SqlDataSource ID="SqlDsMaSP" runat="server"

ConnectionString="<%$ ConnectionStrings:PGKH %>" SelectCommand="PGKH_CboMaSP"

SelectCommandType="StoredProcedure">

</asp:SqlDataSource>

2. combbox thứ 2:

<telerik:RadComboBox ID="ddlCTMaSP" Runat="server" DataSourceID="SqlDsCTMaSP"

DataTextField="CTMaSP" DataValueField="IdCTMaSP"

SelectedValue='<%# Bind("IdCTMaSP") %>' Skin="Office2007" Width ="300px">

</telerik:RadComboBox>

<asp:SqlDataSource ID="SqlDsCTMaSP" runat="server"

ConnectionString="<%$ ConnectionStrings:PGKH %>"

SelectCommand="PGKH_CboChiTietMaSP" SelectCommandType="StoredProcedure">

<SelectParameters>

<asp:ControlParameter ControlID="ddlMaSP" Name="MaSP"

PropertyName="SelectedValue" Type="Int32" />

</SelectParameters>

</asp:SqlDataSource>
I get error When i using Autopostback for two comboxbox, but i not
use Autopostback is not error but two comboxbox not related. Thanks all.

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 23 May 2014, 01:44 PM
Hello Doan,

Could you provide us with your entire implementation, in order to try to replicate the problem locally? In addition, please demonstrate the approach that you use to make the RadComboBoxes related.

Regards,
Nencho
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
DropDownList
Asked by
Doan
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or