After reviewing the documentation and help files I'm still doing something wrong. I can actually get the dropdown to display correctly on and insert and edit modes. Everything is working there fine and saving correctly. I'm having troubles with the value displaying on load. Here's what I've got.
<telerik:GridDropDownColumn UniqueName="WatchdogFrequencyddl" ListTextField="Name" ListValueField="Watchdogfrequencyid" DataField="Watchdogfrequencyid" |
SortExpression="Watchdogfrequencyid" HeaderText="Frequency" DropDownControlType="DropDownList" FooterText="RadComboBox column footer" > |
</telerik:GridDropDownColumn> |
protected void WDTGrid_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridEditableItem && e.Item.IsInEditMode) //fire for both edit and insert |
{ |
GridEditableItem eeditItem = e.Item as GridEditableItem; |
GridEditManager editMgr = editItem.EditManager; |
GridDropDownListColumnEditor wdfEditor = editMgr.GetColumnEditor("WatchdogFrequencyddl") as GridDropDownListColumnEditor; |
string s = DataBinder.Eval(editItem.DataItem, "Watchdogfrequencyid").ToString(); //the field should point to the ListValueField of the dropdown editor |
wdfEditor.DataSource = getWatchdogFrequency(); |
wdfEditor.DataBind(); |
wdfEditor.SelectedValue = s; |
} |
} |