adding button to header, footer or Pager of dataGrid

Discussion in 'ASP .Net Datagrid Control' started by rosh, Oct 7, 2004.

  1. rosh

    rosh Guest

    hi
    i want to know whether is it possible to add button (say DELETE button)
    in the header,footer or Pager of a dataGrid?
    If yes,how do i achieve the same?
    thnkx
    cheers

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    rosh, Oct 7, 2004
    #1
    1. Advertising

  2. rosh

    A Traveler Guest

    Header and footer are easy enough. Which ever column you want the button in,
    simply make it a template column, and then edit the template by
    right-clicking the grid and going to "Edit Template..."

    You can also do it through code, which would be the only way if you want to
    edit the pager. You can handle the OnItemCreated event for the grid, then do
    a Select Case e.Item.ItemType, and look for the type you want to edit. Then
    go ahead and add your controls as you wish.
    ** The only caveat about doing it in code is that it CAN potentially become
    very tricky to create and recreate this controls properly on postbacks and
    rebinds, because of issues with needing to create the pages
    viewstate/control hierarchy in excatly the same fashion it was originally
    created.

    I hope this helps you some.

    "rosh" <> wrote in message
    news:...
    >
    > hi
    > i want to know whether is it possible to add button (say DELETE button)
    > in the header,footer or Pager of a dataGrid?
    > If yes,how do i achieve the same?
    > thnkx
    > cheers
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    A Traveler, Oct 7, 2004
    #2
    1. Advertising

  3. rosh

    rosh Guest

    thnkx a lot for ru quick reply :)
    yeh tht worked :)
    now i will try the same on PAGER of the dataGrid
    now one more question arrises as to whether can i do the same by adding
    image buttons?
    I have a header fielt say "SortIt" and i want that column to be sorted
    both ways(ascd'ng and descending)and also i want to append the image to
    the header text "SortIt"[image]
    All i want is when i click on this header the sorting must take place
    and the image must change according to ascenging n descending sort...
    i tried this by adding a Header Image through ProgramBuilder but then if
    i add the image from there i am not able to see my header text :( wht do
    i do?
    can u suggest some idea for the same
    have a nice time
    cheers

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    rosh, Oct 8, 2004
    #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. =?Utf-8?B?c3Ryb3V0?=

    Adding a dropdownlist in DataGrid Pager area

    =?Utf-8?B?c3Ryb3V0?=, Jan 12, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    394
    Philip Q [MVP]
    Jan 12, 2005
  2. Tumurbaatar S.

    Customizing pager/header/footer

    Tumurbaatar S., Nov 4, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    4
    Views:
    158
    Tumurbaatar S.
    Nov 11, 2005
  3. Henrik
    Replies:
    1
    Views:
    408
    Ken Cox [Microsoft MVP]
    Jul 6, 2006
  4. RB
    Replies:
    2
    Views:
    176
  5. DataGrid: Move Pager to Header?

    , Aug 7, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    109
Loading...

Share This Page