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

display problem

4 Answers 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mww
Top achievements
Rank 1
mww asked on 16 Oct 2008, 06:43 PM
I have a RADGrid on a page, the grid has 2 rows.  Im using a GridDropDownColumn to pick the items for the grid column, but the data isnt being displayed.  The 2 rows are there, but nothing is displayed in the appropriate columns (Category)

<Columns> 
                                        <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID" 
                                            ReadOnly="true" Visible="false" SortExpression="ID" UniqueName="ID">  
                                        </telerik:GridBoundColumn> 
                                          
                                        <telerik:GridDropDownColumn DataField="Category"   
                                            ListTextField="Category" ListValueField="Category" HeaderText="Category" UniqueName="SecondaryCategory">  
                                        </telerik:GridDropDownColumn> 
                                    </Columns> 
 The dropdown appears when I select edit, but not in normal display mode.  Anyone know what im missing here ?

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 17 Oct 2008, 04:29 AM
Hello Mark,

The DropDownColumn will be displayed once you set the DataSourceID of the DropDownColumn. Try setting it as shown below.
cs:
<telerik:GridDropDownColumn DataSourceID="SqlDataSource1" UniqueName="Price" DataField="UnitPrice" ListTextField="UnitPrice" ListValueField="UnitPrice"
 </telerik:GridDropDownColumn> 

Thanks
Princy.
0
mww
Top achievements
Rank 1
answered on 17 Oct 2008, 09:44 AM
Im populating the dropdown in the code behind (c#)  not from a datasource on the page, so I cant set the DataSourceID property in the .aspx page

whats the difference between datasoure and datasourceid ?
0
Princy
Top achievements
Rank 2
answered on 17 Oct 2008, 11:14 AM
Hello Mark,

The difference between DataSource and DataSourceID is as explained below:
DataSource: Gets or sets the object which can include a DataSet or a DataReader from which the data-bound control retrieves its list of data items.

DataSourceID: Gets or sets the ID of the datasourcecontrol from which the data-bound control retrieves its list of data items.

Thanks
Princy.
0
mww
Top achievements
Rank 1
answered on 17 Oct 2008, 11:22 AM
that still doesnt explain the difference between the two.  why have them both if they achieve the same thing ?

im my case I dont have a datasourceid  because im generating the data at runtime using a collection.
Tags
Grid
Asked by
mww
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
mww
Top achievements
Rank 1
Share this question
or