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

[Solved] Export to excel with Validation Choices

1 Answer 128 Views
Grid
This is a migrated thread and some comments may be shown as answers.
aung maw
Top achievements
Rank 1
aung maw asked on 07 May 2009, 12:31 PM
Hi All, Excel export feature works fine, but would like to add a Listbox values in one of the columns during the export.  For example, There is a column called category and when exported this column should not only have category value but also choice for other categories (Apple, Orange, Grape) in a drop down list.  Please let me know.

Thanks,

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 08 May 2009, 04:57 AM
Hi,

Try adding a DropDownList with desired categories in a GridTemplateColumn and while exporting set the ExportOnlyData property to false.

ASPX:
 
 <telerik:GridTemplateColumn UniqueName="TempCol"  HeaderText="Category" > 
            <ItemTemplate> 
            <asp:DropDownList ID="DropDownList1" runat="server" > 
                  <asp:ListItem Text="Apple" ></asp:ListItem> 
                <asp:ListItem Text="Orange" ></asp:ListItem> 
               <asp:ListItem Text="Grape" ></asp:ListItem> 
            </asp:DropDownList> 
            </ItemTemplate> 
          </telerik:GridTemplateColumn> 

CS:
 
 protected void Button2_Click(object sender, EventArgs e) 
    { 
        RadGrid1.ExportSettings.ExportOnlyData = false
        RadGrid1.MasterTableView.ExportToExcel();  
    } 


Thanks
Shinu

Tags
Grid
Asked by
aung maw
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or