Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Drop down list in gridview header dynamically

Reply
Thread Tools

Drop down list in gridview header dynamically

 
 
CDonlan
Guest
Posts: n/a
 
      08-02-2007
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.

 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      08-03-2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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.
>



 
Reply With Quote
 
 
 
 
CDonlan
Guest
Posts: n/a
 
      08-06-2007
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"
<(E-Mail Removed)> 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
> property.
>
> --
> Eliyahu Goldin,
> Software Developer & Consultant
> Microsoft MVP [ASP.NET]http://msmvps.com/blogs/egoldin
>
> "CDonlan" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed) 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.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Affecting a dynamically created drop down from another dynamically created drop down. msimmons ASP .Net 0 07-16-2009 03:17 PM
retrive preselected value in second drop down list from the first drop down list weiwei ASP .Net 0 01-05-2007 07:29 PM
Multiple select drop down poplulating sub drop down scott@dettcom.com Javascript 3 11-09-2006 07:50 PM
Auto Drop down a Drop Down List xxbmichae1@supergambler.com Javascript 5 11-23-2005 01:35 AM
New to .NET, can I have one drop down box control the data of another drop down box using a database? SirPoonga ASP .Net 2 01-07-2005 10:44 PM



Advertisments