When I entered edit mode, rows under my GridDropDownColumn are not being populated. Img1 shows view mode and img2 shows the edit mode of the Radgrid. Here are the codes:
:
protected void grdSalesPerson_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridEditableItem && (e.Item as GridEditableItem).IsInEditMode) |
{ |
GridEditableItem editedItem = e.Item as GridEditableItem; |
GridEditManager editMan = editedItem.EditManager; |
GridDropDownColumnEditor editor = editMan.GetColumnEditor("Manager") as GridDropDownColumnEditor; |
Int64 selectedManagerID = ((User)editedItem.DataItem).ManagerID; |
editor.DataSource = Managers; |
editor.DataTextField = "FullName"; |
editor.DataValueField = "UserID"; |
editor.DataBind(); |
editor.SelectedValue = selectedManagerID.ToString(); |
} |
} |
<MasterTableView EditMode="InPlace" DataKeyNames="UserID"> |
<Columns> |
<telerik:GridBoundColumn DataField="FullName" HeaderText="Salesperson" |
UniqueName="FullName" ReadOnly="True"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="Email" HeaderText="Email" |
UniqueName="Email" ReadOnly="True"> |
</telerik:GridBoundColumn> |
<telerik:GridDropDownColumn UniqueName="Manager" ListDataMember="Users" |
ListTextField="ManagerFullName" ListValueField="ManagerID" |
HeaderText="Manager" DataField="ManagerID"> |
</telerik:GridDropDownColumn> |
</Columns> |
</MasterTableView> |
</telerik:RadGrid> |