datagrid custom (dynamic) pager build at runtime?

Discussion in 'ASP .Net' started by =?Utf-8?B?cGF0cmlja2RyZA==?=, May 6, 2007.

  1. Hi guys!

    I have built a custom pager for my datagrids like in the picture:

    http://i173.photobucket.com/albums/w65/patrickdrd/dev/grid.jpg

    I would like to move that inside the datagrid (on the footer),

    but I'm having trouble with the event,

    I can't catch the button's click event,

    code follows:

    Dim btnFirst1 As New Button
    With btnFirst1
    .ID = "btnFirst1"
    .CommandName = "First"
    .CssClass = "inpNavFirst"

    ''.Attributes("runat") = "server"
    '.ID = "btnFirst1"
    '.CssClass = "inpNavFirst"
    ''.Attributes("OnCommand") = "btnFirst1_Click"
    '.Attributes("CommandName") = "First"
    ''.Attributes("onserverclick") = "btnFirst1_Click"
    ''AddHandler .Click, AddressOf btnFirst1_Click
    End With

    fcell = New TableCell
    fcell.Controls.Add(btnFirst1)
    fcell.ColumnSpan = dgCustomers.Columns.Count
    fcell.HorizontalAlign = HorizontalAlign.Center

    Dim dgItemFooter As New DataGridItem(0, 0, ListItemType.Footer)
    dgItemFooter.Cells.Add(fcell)
    dgCustomers.Controls(dgCustomers.Controls.Count -
    1).Controls.Add(dgItemFooter)



    I tried anything you can see in comments,

    nothing worked!

    Can somebody help me out please?

    Thanks in advance!
    =?Utf-8?B?cGF0cmlja2RyZA==?=, May 6, 2007
    #1
    1. Advertising

  2. > I would like to move that inside the datagrid (on the footer),
    >
    > but I'm having trouble with the event,
    >
    > I can't catch the button's click event,


    Use "Command" event of the datagrid.
    And then specify the "CommandName" and "CommandArgument" for the button.


    --
    Happy Hacking,
    Gaurav Vaish | www.mastergaurav.com
    www.edujini-labs.com
    http://eduzine.edujini-labs.com
    -----------------------------------------
    MasterGaurav \(www.edujini-labs.com\), May 6, 2007
    #2
    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. kgs

    pager in datagrid

    kgs, Nov 25, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    445
    Saravana [MVP]
    Nov 27, 2003
  2. Binny
    Replies:
    2
    Views:
    995
    Binny
    Dec 10, 2003
  3. Mark Warner

    Datagrid's pager style

    Mark Warner, Feb 26, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    6,696
    Marshal Antony
    Feb 27, 2004
  4. Mr. SweatyFinger

    cUSTOM PAGER

    Mr. SweatyFinger, Feb 26, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    391
    Mr. SweatyFinger
    Feb 26, 2007
  5. Mr. SweatyFinger

    gridview custom pager with command buttons

    Mr. SweatyFinger, Feb 26, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    422
    Mr. SweatyFinger
    Feb 26, 2007
Loading...

Share This Page