Hi Telerik,
I have a grid with a dropDownColumn:
I must populate manually the dropdown every time I enter to edit mode. So I populate it manually, but before that I want to save the selected value so I can focus on the selection in the drop down again.
This is two methods I tried BEFORE I re-populate the dropdown:
none is showing the correct selected value. Keep in mind that before I re-populate the combo, the items count is 0. But I still want to retain the last saved value!
I have a grid with a dropDownColumn:
<telerik:GridDropDownColumn DataField="bitPRI" HeaderText="bitPRI" SortExpression="bitPRI" |
UniqueName="bitPRI" DropDownControlType="DropDownList" ForceExtractValue="Always"> |
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /> |
</telerik:GridDropDownColumn> |
I must populate manually the dropdown every time I enter to edit mode. So I populate it manually, but before that I want to save the selected value so I can focus on the selection in the drop down again.
This is two methods I tried BEFORE I re-populate the dropdown:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridEditableItem && e.Item.IsInEditMode) |
{ |
GridEditableItem eeditedItem = e.Item as GridEditableItem; |
GridEditManager editMan = editedItem.EditManager; |
GridDropDownListColumnEditor editor_bitPRI = (GridDropDownListColumnEditor)(editMan.GetColumnEditor("bitPRI")); |
GridDropDownColumnEditor editor_bitPRI_TEST = (GridDropDownColumnEditor)(editMan.GetColumnEditor("bitPRI")); |
System.Diagnostics.Debug.WriteLine(editor_bitPRI_TEST.SelectedValue); |
System.Diagnostics.Debug.WriteLine(editedItem["bitPRI"].Text); |
DropDownList editor_bitPRIeditor_bitPRIComboBoxControl = editor_bitPRI.DropDownListControl; |
System.Diagnostics.Debug.WriteLine(editor_bitPRI.DropDownListControl.SelectedValue); |