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

Dropdown list from aspx to excel export

2 Answers 247 Views
Grid
This is a migrated thread and some comments may be shown as answers.
faisal
Top achievements
Rank 1
faisal asked on 09 Aug 2011, 05:31 AM
Hi,

i am populating dropdownlists in a grid and want to export in excel as it is with data. how can i do this.
please help

With Regards,

Faisal

2 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 11 Aug 2011, 05:28 PM
Hello Faisal,

You can replace the dropdown control with the value of the corresponding datafield on ItemDataBound event.
if (e.Item is GridDataItem && isExport)
{
    GridDataItem item = e.Item as GridDataItem;
    item["MyColumn"].Text = DataBinder.Eval(item.DataItem, "FieldName").ToString();
}

Kind regards,
Daniel
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Gangyada
Top achievements
Rank 1
answered on 23 Dec 2014, 12:13 PM
There are multiple ways in which you can create a dropdown list in Excel.
Data Validation
Form Control (Combo Box)
ActiveX Control (Combo Box)
But of these methods, Data Validation is the most used method, for its simplicity. Later on, I’ll explain the pros and cons of each method, so that you can choose the best method among these for you.

Before going to explain how to create a dropdown list, let me tell you what a Data Validation is? It controls the type of data or the values that users enter into a cell. For example, you may want to enter only positive values in a cell, only ‘time’ in a column, or a text below the specified length. You can define all these conditions through Data Validation. Even dropdown list is a data validation where you’re constraining the user to use only those set of words in that cell. Again, in creating a dropdown list through data validation, there are different ways in doing it.

Writing the complete list in the Source Field
1) Select the Cell (or) set of Cells in which you want to see the dropdown. 2) Go to “Data” Tab –> Data Validation –> Data Validation 3) Select List in the “Allow box” 4) Just enter the names you want to see in the dropdown list in the “Source” Box Excel Consultant






Tags
Grid
Asked by
faisal
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Gangyada
Top achievements
Rank 1
Share this question
or