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

DropDownlist instead of Column name in RadGrid

1 Answer 36 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mugdha Aditya
Top achievements
Rank 1
Mugdha Aditya asked on 24 Dec 2011, 12:45 PM
Thnx..:)

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 1
answered on 26 Dec 2011, 06:36 AM
Hello Mugdha,

Try the following code.
C#:
void grid_ItemDataBound(object sender, GridItemEventArgs e)
{
 if (e.Item is GridHeaderItem)
 {
   GridHeaderItem item = (GridHeaderItem)e.Item;
   TableCell cell = (TableCell)item["UniqueName"];
   DropDownList ddl = new DropDownList();
   ddl.DataSourceID = "SqlDataSource1";
   ddl.DataTextField= "ID";
   ddl.DataValueField = "ID";
   cell.Controls.Add(ddl);
 }
}

-Shinu.
Tags
Grid
Asked by
Mugdha Aditya
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Share this question
or