I have a RadGrid which lists addresses. I have configured it to popup during edit, in which there are 2 dropdown lists, for country and for province - the first dropdown being set to AutoPostBack=true, so that any change there, will also change the list of provinces available.
But when I change the country selection, I get this error "Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control."
Any ideas on how to get around this problem?
=================
<td>
Country:</td>
<td>
<asp:ObjectDataSource ID="obCountry" runat="server"
SelectMethod="GetAllCountries"
TypeName="CNH.CountryController">
</asp:ObjectDataSource>
<asp:DropDownList ID="cbCountry" runat="server" AutoPostBack="True" SelectedValue='<%# Bind("intCountry") %>'
DataSourceID="obCountry" DataTextField="txtName"
DataValueField="intcountry">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
Province:</td>
<td>
<asp:ObjectDataSource ID="obProv" runat="server"
SelectMethod="GetAllProvinces"
TypeName="CNH.ProvStateController" >
<SelectParameters>
<asp:ControlParameter ControlID="cbCountry"
Name="intCountry" PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:DropDownList ID="cbProv" runat="server"
DataSourceID="obProv" DataTextField="txtname" SelectedValue='<%# Bind("intprovstate") %>'
DataValueField="intprovstate">
</asp:DropDownList>
</td>
But when I change the country selection, I get this error "Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control."
Any ideas on how to get around this problem?
=================
<td>
Country:</td>
<td>
<asp:ObjectDataSource ID="obCountry" runat="server"
SelectMethod="GetAllCountries"
TypeName="CNH.CountryController">
</asp:ObjectDataSource>
<asp:DropDownList ID="cbCountry" runat="server" AutoPostBack="True" SelectedValue='<%# Bind("intCountry") %>'
DataSourceID="obCountry" DataTextField="txtName"
DataValueField="intcountry">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
Province:</td>
<td>
<asp:ObjectDataSource ID="obProv" runat="server"
SelectMethod="GetAllProvinces"
TypeName="CNH.ProvStateController" >
<SelectParameters>
<asp:ControlParameter ControlID="cbCountry"
Name="intCountry" PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:DropDownList ID="cbProv" runat="server"
DataSourceID="obProv" DataTextField="txtname" SelectedValue='<%# Bind("intprovstate") %>'
DataValueField="intprovstate">
</asp:DropDownList>
</td>