[SOLVED] DataGridView Footer

Answered
0
0

Any plans to add Footer row to DataGridView.

I would need to create a column totals, that are scrolling (following columns) as user is moving in GridView?

Thanx,

DiNo

  • You must to post comments
Best Answer
0
0

Sorry for the late reply to your last comment. The sample is a starting point, it can be adapted as needed. You can access the summary grid using this.dataGrid1.SummaryGrid. For example, to sync column width when changed by code:

 

protected override void OnColumnWidthChanged(DataGridViewColumnEventArgs e)
{
  this.childGrid.Columns[e.Column.Index].Width = e.Column.Width;
  base.OnColumnWidthChanged(e);
}

We have also just published an extension that creates subtotal rows at various levels and positions (not frozen because they work on grouping). See https://wisej.com/extensions/

Added updated sample.

  • You must to post comments
0
0

Here is a sample app with a composite grid and sync’d columns. See DataGridViewWithBottomRows.InitScript and CssStyle proeprties. You can use the same approach to add rows at the top or any child control to make up a composite grid.

 

 

  • Dino Novak
    Hi, thanks for sample, I am trying to use it but I can see that customization of columns are not applied to both grids. so all is OK if widths are 100 (defaut) if I change it sync between grids is lost. Also cell formatting is not applied to grid like alignment of format. How to overcome this? Thanx, D
  • You must to post comments
0
0

We have to support frozen rows (top and bottom) on our todo list. Don’t have a date yet.

However, the Wisej DataGridView is also a container, you can drop other controls to it and use the Dock property to create a composite grid – and you can make them resizable (ResizableEdges) to act as it there was a splitter: i.e. toolbar, detail grid, navigation tree, etc.

You could add a second grid to the bottom without the column header and without the vertical scrollbar (see ScrollBars property) and then sync the column resize, move and horizontal scrolling on the client. You can also decide where to show the horizontal scrollbar.

We did this in our other framework for the Gupta/SQLWindows to Web migration and I can attach the javascript to sync the grids if you like the solution. You’d have to create the second grid with the same columns – could use the column.Clone() method for that.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.