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

GridDropDownColumn

2 Answers 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mww
Top achievements
Rank 1
mww asked on 18 Oct 2008, 04:35 PM

I have a grid with a GridDropDownColumn.  In normal browse mode the data wont display, even though there are rows in the grid, the column GridDropDownColumn doesnt show the data.  If I select edit, the drop down appears with the data.  Ive been trying to find a solution to this for quite a while, even telerik support cant help me.  Can anyone help ?  Heres the code for the grid.

<telerik:RadGrid ID="RadGridSecondaryCategories" runat="server" OnNeedDataSource="RadGridSecondaryCategories_NeedDataSource" 
                                AutoGenerateEditColumn="True" AutoGenerateDeleteColumn="True" AllowAutomaticInserts="False" 
                                AllowAutomaticDeletes="False" GridLines="None"   
                                AllowAutomaticUpdates="False" AllowSorting="True" 
                                Skin="Vista" AllowMultiRowEdit="False"   
                                onitemcommand="RadGridSecondaryCategories_ItemCommand"   
                                onitemdatabound="RadGridSecondaryCategories_ItemDataBound"   
                                ondeletecommand="RadGridSecondaryCategories_DeleteCommand"   
                                oninsertcommand="RadGridSecondaryCategories_InsertCommand"   
                                onupdatecommand="RadGridSecondaryCategories_UpdateCommand" PageSize="5">  
                                <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="False" OverrideDataSourceControlSorting="True" 
                                    EditMode="InPlace" UseAllDataFields="True" > 
                                    <RowIndicatorColumn> 
                                        <HeaderStyle Width="20px" /> 
                                    </RowIndicatorColumn> 
                                    <ExpandCollapseColumn> 
                                        <HeaderStyle Width="20px" /> 
                                    </ExpandCollapseColumn> 
                                    <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" Display="True">  
                                        </telerik:GridDropDownColumn> 
                                    </Columns> 
                                       
 
                                </MasterTableView> 
                                <FilterMenu EnableTheming="True">  
                                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                                </FilterMenu> 
                            </telerik:RadGrid> 

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 20 Oct 2008, 04:01 AM
Hi Mark,

You have not set any DataSourceID for the DropDown Column. Try setting the DataSourceID and see if it is working.

ASPX:
<telerik:GridDropDownColumn DataField="Category"   DataSourceID="SqlDataSource1"    ListTextField="Category" ListValueField="Category" HeaderText="Category" UniqueName="SecondaryCategory" Display="True">   
                                        </telerik:GridDropDownColumn>  


You can also go through the following help article.
Customize/Configure GridDropDownColumn

Thanks
Shinu.
0
mww
Top achievements
Rank 1
answered on 20 Oct 2008, 12:48 PM
I cant set the DatasourceID in the aspx page because the data for the dropdown is generated dynamically depening on a user selection elsewhere on the page.  The only way I can get it to work is to use a GridTemplateColumn

<telerik:GridTemplateColumn    HeaderText="Category"  DataField="Category"  UniqueName="Category" >    
                                         <ItemTemplate>    
                                             <asp:Label ID="Label1" runat="server" Text='<%#Eval("Category") %>' ></asp:Label>    
                                         </ItemTemplate>    
                                         <EditItemTemplate> 
                                             <telerik:RadComboBox ID="RadComboBoxCategories" runat="server" Skin="Vista">  
                                             </telerik:RadComboBox> 
                                            
                                         </EditItemTemplate>    
                                             
                                        </telerik:GridTemplateColumn>   
Tags
Grid
Asked by
mww
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
mww
Top achievements
Rank 1
Share this question
or