Drop down list in gridview header dynamically

Discussion in 'ASP .Net' started by CDonlan, Aug 2, 2007.

  1. CDonlan

    CDonlan Guest

    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, Aug 2, 2007
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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, Aug 3, 2007
    #2
    1. Advertising

  3. CDonlan

    CDonlan Guest

    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"
    <> 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" <> wrote in message
    >
    > news:...
    >
    > > 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, Aug 6, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SirPoonga
    Replies:
    2
    Views:
    783
    Ben Strackany
    Jan 7, 2005
  2. weiwei
    Replies:
    0
    Views:
    1,035
    weiwei
    Jan 5, 2007
  3. msimmons
    Replies:
    0
    Views:
    498
    msimmons
    Jul 16, 2009
  4. Replies:
    5
    Views:
    284
  5. Replies:
    3
    Views:
    297
Loading...

Share This Page