Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

Drop down list in gridview header dynamically

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CDonlan - 02 Aug 2007 19:22 GMT
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.
Eliyahu Goldin - 03 Aug 2007 07:26 GMT
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.

Signature

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.
CDonlan - 06 Aug 2007 21:13 GMT
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.org> wrote:
> 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
[quoted text clipped - 8 lines]
> > columns can change so it has to be done in the code behind (the .cs
> > file). Please help me with this.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.