The front End code:
<telerik:GridDropDownColumn DataSourceID="DSCategories" ListTextField="CategoryName" ListValueField="CategoryID"
UniqueName="CategoryDD" SortExpression="CategoryName" HeaderText="Category" DataField="CategoryID"
DropDownControlType="RadComboBox" FooterText="RadComboBox column footer"
AllowAutomaticLoadOnDemand="true" AllowVirtualScrolling="true" ShowMoreResultsBox="true"
ItemsPerRequest="10">
</telerik:GridDropDownColumn>
The Backend Code:
protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e)
{
GridEditFormInsertItem insertItem = e.Item as GridEditFormInsertItem;
RadComboBox DDCat = (insertItem["CategoryDD"].Controls[0] as RadComboBox);
int DDcategory = Convert.ToInt16(DDCat.SelectedValue);
}
Please Donate To Bitcoin Address: [[address]]
Donation of [[value]] BTC Received. Thank You.
[[error]]
James,
ReplyDeleteThanks a lot for sharing. This post saved me a lot of time. I appreciate your help very much. This really is a wonderful world.
Very glad I could help, the whole reason I post anything on his blog is for exactly that, to help save someone else the time and pass on the knowledge.
ReplyDeleteThank you,
James Campbell
MCP,MCSA,MCSE,Security +
tel - five seven zero - 223 - 8452
hi..how can I apply this if my combobox belongs to EditTemplate?
ReplyDeleteCan you post your code in which you have it in the EditTemplate?
DeleteThank you,
Jim
Using ComboBox in GridView column in Windows Forms
ReplyDelete