datagrid footer question

Discussion in 'ASP .Net Datagrid Control' started by mark, Sep 6, 2004.

  1. mark

    mark Guest

    im keeping running totals of certain columns in a datagrid, id like to put
    these totals in the footer - how do i do this ? or how can i put a label
    into the footer ? (im displaying results using labels instead at the moment)
    eg

    Label5.Text = "Column 1 Total:- " & mordraw & " (Ratio " &
    FormatNumber(ddpercent, 2) & "%)"

    id like that putting in the column1 footer if possible
    thanks
    mark
    mark, Sep 6, 2004
    #1
    1. Advertising

  2. in your itemdatabound event handler:
    if(e.item.listtype == listtype.footer)
    {
    e.item.cells[2].text = "some total";
    }

    roughly (meaning it won't compile but this is the general idea)
    --
    Regards,
    Alvin Bruney
    [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
    Got tidbits? Get it here... http://tinyurl.com/27cok
    "mark" <> wrote in message
    news:5MU_c.414$...
    > im keeping running totals of certain columns in a datagrid, id like to put
    > these totals in the footer - how do i do this ? or how can i put a label
    > into the footer ? (im displaying results using labels instead at the
    > moment)
    > eg
    >
    > Label5.Text = "Column 1 Total:- " & mordraw & " (Ratio " &
    > FormatNumber(ddpercent, 2) & "%)"
    >
    > id like that putting in the column1 footer if possible
    > thanks
    > mark
    >
    >
    Alvin Bruney [MVP], Sep 7, 2004
    #2
    1. Advertising

  3. mark

    mark Guest

    "Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
    news:...
    > in your itemdatabound event handler:
    > if(e.item.listtype == listtype.footer)
    > {
    > e.item.cells[2].text = "some total";
    > }
    >
    > roughly (meaning it won't compile but this is the general idea)
    > --


    problem is i dont have an event handler - the datagrid is created on runtime
    (its a report)
    mark, Sep 8, 2004
    #3
  4. you will need to dynamically wire in an event handler then.

    --
    Regards,
    Alvin Bruney
    [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
    Got tidbits? Get it here... http://tinyurl.com/27cok
    "mark" <> wrote in message
    news:xSy%c.13$...
    >
    > "Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
    > news:...
    >> in your itemdatabound event handler:
    >> if(e.item.listtype == listtype.footer)
    >> {
    >> e.item.cells[2].text = "some total";
    >> }
    >>
    >> roughly (meaning it won't compile but this is the general idea)
    >> --

    >
    > problem is i dont have an event handler - the datagrid is created on
    > runtime
    > (its a report)
    >
    >
    Alvin Bruney [MVP], Sep 8, 2004
    #4
    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. Roger Moore
    Replies:
    0
    Views:
    741
    Roger Moore
    Jul 7, 2003
  2. Darren Spooner

    remove a control from a datagrid footer

    Darren Spooner, Oct 14, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    338
    Alvin Bruney
    Oct 15, 2003
  3. Dave

    Datagrid FindControl in Footer

    Dave, Nov 14, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    3,048
  4. stephen

    DataGrid Header and Footer Question

    stephen, Aug 15, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    402
    Patrick.O.Ige
    Aug 16, 2006
  5. Henrik
    Replies:
    1
    Views:
    416
    Ken Cox [Microsoft MVP]
    Jul 6, 2006
Loading...

Share This Page