how do I add a Footer to a datagrid (windows forms)
-
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!!
Put a
Label
control or something similar under theDataGrid
. You can update theLabel.Text
property by aggregating the values in a particular column of yourDataGrid
. We do that in our app in several cases. Note thatSystem.Windows.Forms.DataGrid
andSystem.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-----
-
Put a
Label
control or something similar under theDataGrid
. You can update theLabel.Text
property by aggregating the values in a particular column of yourDataGrid
. We do that in our app in several cases. Note thatSystem.Windows.Forms.DataGrid
andSystem.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-----
Thank you.