Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how do I add a Footer to a datagrid (windows forms)

how do I add a Footer to a datagrid (windows forms)

Scheduled Pinned Locked Moved C#
questioncsharpasp-netwinformshelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mdolby
    wrote on last edited by
    #1

    Hello, I want to add a footer to a datagrid in a windows forms (like the datagrid for asp.net).. How do I go about doing this??? For example I want to display the totals of a columns in the footer.. any help is appreciated!!

    H 1 Reply Last reply
    0
    • M mdolby

      Hello, I want to add a footer to a datagrid in a windows forms (like the datagrid for asp.net).. How do I go about doing this??? For example I want to display the totals of a columns in the footer.. any help is appreciated!!

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      Put a Label control or something similar under the DataGrid. You can update the Label.Text property by aggregating the values in a particular column of your DataGrid. We do that in our app in several cases. Note that System.Windows.Forms.DataGrid and System.Web.UI.WebControls.DataGrid are very different, both in terms of presentation and logic. The former is a Windows Control that binds differently than the latter, and the latter generates an HTML <table>, which makes having a footer template trivial (since it just uses the <tfoot> tag and adds your rows and columns). They are very different beasts and, IMO, should not be compared.

      -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

      J 1 Reply Last reply
      0
      • H Heath Stewart

        Put a Label control or something similar under the DataGrid. You can update the Label.Text property by aggregating the values in a particular column of your DataGrid. We do that in our app in several cases. Note that System.Windows.Forms.DataGrid and System.Web.UI.WebControls.DataGrid are very different, both in terms of presentation and logic. The former is a Windows Control that binds differently than the latter, and the latter generates an HTML <table>, which makes having a footer template trivial (since it just uses the <tfoot> tag and adds your rows and columns). They are very different beasts and, IMO, should not be compared.

        -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

        J Offline
        J Offline
        john ingram
        wrote on last edited by
        #3

        Thank you.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups