We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Totals at bottom of Grid?

Thread ID:

Created:

Updated:

Platform:

Replies:

2550 Jan 29,2003 09:25 PM UTC Sep 16,2003 05:47 AM UTC WinForms 6
loading
Tags: GridControl
Mac
Asked On January 29, 2003 09:25 PM UTC

Hi I have a data bound grid which has 2 columns which holds financial amounts. What I would like to do is have the last row to hold the total of these columns. Anybody have any idea on how to do this? Mac

Thomas Brix Lyng
Replied On January 30, 2003 10:19 AM UTC

Hi Mac I have just found this solution and it works for me. Try it out. You can pick up the link for the solution in the attached .zip document. regards Thomas > Hi > > I have a data bound grid which has 2 columns which holds financial amounts. > > What I would like to do is have the last row to hold the total of these columns. > > Anybody have any idea on how to do this? > > Mac > >

Administrator [Syncfusion]
Replied On January 30, 2003 10:34 AM UTC

One way you could try to do this is to add a unbound row at the top of your datagrid, and set the formula cells into this unbound row. The GDBGMultiHeader sample shows how you might add this extra header row whose information is stored in the grid's data object (and not in your datatable). But this puts the totals at the top. If you want them at the bottom, its more work. What you could do is hide this extra top row, and add a virtual GridControl docked under the GriddataBoundGrid that just displays the values from this hidden row. Attached is a try at doing this. It uses a panel to hold the 2 grids, and positions the grids on the panel so the gridcontrol is exactly under the GridDataBoundGrid. It also makes sure the panel is sized so a whole number of rows are visible so things look OK. If you want to allow the user's to scroll horizontally, then there is more work. You would need to add Windows Forms scrollbars to the panel, and use those scroll bars to scroll the GriddataBoundGrid. The ScrollBars sample that ships with the products steps you through this task.

Administrator [Syncfusion]
Replied On January 31, 2003 01:29 PM UTC

Clay, What you mentioned in the above post can be done. But it takes too much of effort everytime we need something like this. This is a feature request. What we need is a "Summary row" in the GridControlBase at the bottom of the grid. The summary row will contain the same number of columns as the grid. But what needs to be displayed in each cell can be specified by the programmer using an event. E.g.: Totals of the column, Avg. of the column, number of rows in that column that have value > 1000 etc. "Summary Row" should be visible all the time even when the control is scolled vertically (just like column header, but at the bottom), so that the user can see the totals anytime the values are changed. thanks, - Reddy

Sean Wilkins
Replied On September 15, 2003 04:37 PM UTC

Would you happen to have a VB.Net version of this that you could intorduce to the forum? Thanks! > One way you could try to do this is to add a unbound row at the top of your datagrid, and set the formula cells into this unbound row. The GDBGMultiHeader sample shows how you might add this extra header row whose information is stored in the grid's data object (and not in your datatable). > > But this puts the totals at the top. If you want them at the bottom, its more work. What you could do is hide this extra top row, and add a virtual GridControl docked under the GriddataBoundGrid that just displays the values from this hidden row. > > Attached is a try at doing this. It uses a panel to hold the 2 grids, and positions the grids on the panel so the gridcontrol is exactly under the GridDataBoundGrid. It also makes sure the panel is sized so a whole number of rows are visible so things look OK. > > If you want to allow the user's to scroll horizontally, then there is more work. You would need to add Windows Forms scrollbars to the panel, and use those scroll bars to scroll the GriddataBoundGrid. The ScrollBars sample that ships with the products steps you through this task.

Sean Wilkins
Replied On September 15, 2003 04:46 PM UTC

Would you happen to have a VB.Net version of this that you could intorduce to the forum?

Administrator [Syncfusion]
Replied On September 16, 2003 05:47 AM UTC

In our 2.0 release, the new grouping support will support summary rows directly without the work that was done to get the above sample to work. Beta version of this code base should be available in the next week or so. I will try to post a VB version of this sample later this week. But I think it needs to be reworked to support the 1.6.1.x code base.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;