This is a migrated thread and some comments may be shown as answers.

GridDropDownColumn not populating succeeding rows

2 Answers 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Web team
Top achievements
Rank 1
Web team asked on 22 Apr 2010, 11:25 AM
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> 

2 Answers, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 22 Apr 2010, 11:39 AM
Hi Arnold,

The built-in GridDropDownColumn is designed to be used mainly with DataTables in order to easily map and generate their dropdown items values in conjunction with the DataField/ListValueField/DataSourceID/ListDataMember values of the column.

If you want to bind the data in the grid dropdown editors programmatically, consider replacing the GridDropDownColumn with a template column holding MS DropDownList in its edit template.

For more details refer to this topic from the product help.

Regards,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Web team
Top achievements
Rank 1
answered on 22 Apr 2010, 12:02 PM
thanks for the quick response. That solves the issue
Tags
Grid
Asked by
Web team
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Web team
Top achievements
Rank 1
Share this question
or