By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,030 Members | 2,277 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,030 IT Pros & Developers. It's quick & easy.

Drop down list in gridview header dynamically

P: n/a
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.

Aug 2 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
"CDonlan" <cd*****@gmail.comwrote in message
news:11**********************@z24g2000prh.googlegr oups.com...
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.

Aug 3 '07 #2

P: n/a
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.

On Aug 3, 3:28 am, "Eliyahu Goldin"
<REMOVEALLCAPITALSeEgGoldD...@mMvVpPsS.orgwrote:
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

"CDonlan" <cdon...@gmail.comwrote in message

news:11**********************@z24g2000prh.googlegr oups.com...
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.

Aug 6 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.