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

Dynamically Created GridDropDownColumn's DataSourceID not found

1 Answer 124 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Todd
Top achievements
Rank 1
Todd asked on 29 Jan 2009, 05:30 PM
I am attempting to build a RadGrid programmatically utilizing GridDropDownColumns.  Each GridDropDownColumn will need to be bound to a DataSource object for population.  The DataSourceID specified will always throw the error: Cannot find DataSourceControl with ID 'xxx'.  Is this an issue with dynamic column creation and binding or is there another way to populate the GridDropDownColumn server-side?

HTML code:
<telerik:RadPageView runat="server" ID="viewXX" /> //Control to load the RadGrid into
<asp:XmlDataSource ID="XmlDataSource1" runat="server">  
                <Data>
                    <Items>
                          <Item Value="Ms" Text="Ms."/>  
                          <Item Value="Dr" Text="Dr."/>  
                          <Item Value="Mrs" Text="Mrs."/>  
                          <Item Value="Mr" Text="Mr."/>  
                    </Items>
                </Data>
</asp:XmlDataSource>

C# code:
RadGrid radgrid = new RadGrid();
GridDropDownColumn boundColumnList = new GridDropDownColumn();
boundColumnList.DataSourceID = "XmlDataSource1";
radgrid.MasterTableView.Columns.Add(boundColumnList);

1 Answer, 1 is accepted

Sort by
0
Todd
Top achievements
Rank 1
answered on 29 Jan 2009, 05:58 PM
Ignore this post i suppose.  I guess I need to set the ListDataMember instead of the DataSourceID on the GridDropDownColumn.
Tags
Grid
Asked by
Todd
Top achievements
Rank 1
Answers by
Todd
Top achievements
Rank 1
Share this question
or