Home Forums WinForms controls Xceed Grid for WinForms get cell value Reply To: get cell value

User (Old forums)
Member
Post count: 23064

Well, you could add a ValueRow to the FooterRows of the detail grid, and set the value of the cell of that numeric column to the sum of the DataRows. Here’s some (untested) code:<code>// create the sum-row and add it to the FooterRows of the detail grid
Xceed.Grid.ValueRow sumRow = new Xceed.Grid.ValueRow();
detailGrid.FooterRows.Add(sumRow);

// calculate the sum of the column
double sum = 0.0;
foreach(DataRow row in detailGrid.DataRows)
sum += (double)row.Cells[“sumColumn”].Value;
sumRow[“sumColumn”].Value = sum;</code>

Imported from legacy forums. Posted by Tommy (had 448 views)