473,320 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Drop down list in gridview header dynamically

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
2 2945
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Gurry | last post by:
Hi there I would like to write a javascript function that creates a drop-down list dynamically. I read on the docs that most HTML controls can not be created on run-time. what kind of...
2
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will...
1
by: Bishop | last post by:
I made a GridView with a Drop Down List using the example here: http://www.orcsweb.com/articles/dotnet_control_templates.aspx It appears to work except that it dosn't actually save the updated...
6
by: mcgrew.michael | last post by:
I hope this is the right group. I am very new to ASP so this is probably a stupid question. I have some vbscript that query's AD and populates a recordset. I know the recorset contains the...
3
by: Yi Chen | last post by:
We have a drop down list on a PHP page, with several product names, and when people click one item, we will refresh the same page with the product name as parameter, and in turn we want to include...
0
by: ayneekeaw | last post by:
When I click the update button/link at the Gridview to update the data from drop down list into the SQL. The selected value of drop down list change to default value. How can I fix this problem
2
by: McGeeky | last post by:
Hi. I have a read only GridView. For each row I want to display a drop down list which contains a list of actions the user can select from for that particular row. E.g. "view details". When they...
3
by: Slickuser | last post by:
Hi, I would like to put a drop down menu in a gridview with the datatype selected from the SQL database. These are the values will show. red orange white green
3
by: DaveRook | last post by:
Hi I am using C# and Access databse for a web site. I have a drop down list which I need to populate dynamically according to results in a database. Example There will be 1 drop down list...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.