Drop down list in gridview header dynamically

C

CDonlan

I'm trying to add a drop down list to a gridview header. The number of
columns can change so it has to be done in the code behind (the .cs
file). Please help me with this.
 
E

Eliyahu Goldin

Do it in either RowCreated or RowDataBound event. Both fire for every grid
row, including the header. You can tell the header by looking in the RowType
property.
 
C

CDonlan

Thanks a lot. I ended up adding it on the row data bound. Can you help
me out with even handling? Im doing

ddl.SelectedIndexChanged += new EventHandler(HandelDropDownList);

but its throwing an error.

Thanks.

Do it in either RowCreated or RowDataBound event. Both fire for every grid
row, including the header. You can tell the header by looking in the RowType
property.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]http://msmvps.com/blogs/egoldin


I'm trying to add a drop down list to a gridview header. The number of
columns can change so it has to be done in the code behind (the .cs
file). Please help me with this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top