theGrid.DisplayLayout.Bands(0).Summaries.Add(SummaryType.Sum, theColumn).
The summaries at the bottom of the columns show up correctly. The problem I am having is that whenever I check or uncheck a checkbox in a column, the summary total does not update until I leave the cell. Is there a way to programmatically have the Wingrid run its column summary? I can capture the fact that the check box in the cell has changed its value, but can't seem to find how to recalculate the column.
UpdateData works too. Glad it's working for you.
-Matt
I meant to use the Update method on the row, sorry. The grid uses the UpdateMode property to determine when the value should be committed to a cell. The reason it isn't immediately available as the value when the text (or in the checkbox's case, the check) changes is that the user could in general perform several changes (i.e. type several characters) before actually wanting to commit the value, but you have the option of forcing the value to get committed to the underlying row. I suppose that you could also try calling PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.ExitEditMode) after the value is updated and see if that causes the summaries to be updated.
OK...forget my last post. The moment I submitted it, I went back and found an UpdateData() method on the grid itself. Now in the CellChange event, after I process what I need to when the check box state changes, I call
theGrid.UpdateData()
and that seems to update the Summary at the bottom of the column as well as keeping the data in synch when I save off the DataSet without leaving the cell.
Matt, I apologize if that is what you were referring to in you last post.
There does not seem to be an Update method on the cell. There is a Refresh() but that did not seem to do anything. (in the CellChange event, I did e.Cell.Refresh())
I am seeing this same problem in another way. My application has the ability of saving off the DataSet associated with my grid to an XML file. If I check a check box in a cell but do NOT leave the cell, when I save the DataSet, the value for that field is still FALSE. If I click on another cell after checking the checkbox in a cell, then save the DataSet, it recognizes TRUE for the field.
I suppose I could select another cell and the reselect the current cell behind the scenes, but that seems a little clumsy.
No, the value isn't changed at this point. You could call Update() on the cell to do so, I believe.