I am using RadControls-grdInsertUpdateDeleteAtDatabaseLevel sample program in http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/alleditablecolumns/defaultcs.aspx
I want to show a grid field as a drop down from another datasource. But I am getting an error when I am trying to update it. I have given here what I have done currently. I am getting this error when I add the drop down. Can you tell me how can I add it to the .cs code to get the selected ID.
.ASPX
<telerik:GridBoundColumn DataField="Password" HeaderText="Password" UniqueName="Password"> </telerik:GridBoundColumn>
<telerik:GridDropDownColumn DataField="CompanyID" DataSourceID="SqlDataSource2"HeaderText="CompanyID" ListTextField="CompanyName" ListValueField="CompanyID" UniqueName="CategoryID" ColumnEditorID="GridDropDownColumnEditor1"></telerik:GridDropDownColumn>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:TestDataConnectionString2 %>" SelectCommand="SELECT [CompanyID], [CompanyName], [CompanyCode], [AddressLine01], [AddressLine02], [AddressLine03], [AddressLine04], [PostCode], [Country], [Telephone], [Fax], [Web], [default] FROM [tbl_LU_Companies]"></asp:SqlDataSource>
.CS
string Password = (editedItem["Password"].Controls[0] as TextBox).Text;
string CompanyID = (editedItem["CompanyID"].Controls[0] as TextBox).Text;
How can I get the Company ID. Can you help me please.
Thank you,
I want to show a grid field as a drop down from another datasource. But I am getting an error when I am trying to update it. I have given here what I have done currently. I am getting this error when I add the drop down. Can you tell me how can I add it to the .cs code to get the selected ID.
.ASPX
<telerik:GridBoundColumn DataField="Password" HeaderText="Password" UniqueName="Password"> </telerik:GridBoundColumn>
<telerik:GridDropDownColumn DataField="CompanyID" DataSourceID="SqlDataSource2"HeaderText="CompanyID" ListTextField="CompanyName" ListValueField="CompanyID" UniqueName="CategoryID" ColumnEditorID="GridDropDownColumnEditor1"></telerik:GridDropDownColumn>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:TestDataConnectionString2 %>" SelectCommand="SELECT [CompanyID], [CompanyName], [CompanyCode], [AddressLine01], [AddressLine02], [AddressLine03], [AddressLine04], [PostCode], [Country], [Telephone], [Fax], [Web], [default] FROM [tbl_LU_Companies]"></asp:SqlDataSource>
.CS
string Password = (editedItem["Password"].Controls[0] as TextBox).Text;
string CompanyID = (editedItem["CompanyID"].Controls[0] as TextBox).Text;
How can I get the Company ID. Can you help me please.
Thank you,