| | | | Browse by category |
Problem
How should I fill the grid with values?
Cause
Action
SetValueRange() and SetStyleRange() let you change cell values and formatting. It is recommended that you call LockUpdate(TRUE) before you do several SetValueRange() calls. Upon initialization of the grid, you should also turn off undo creation.
Example:
// turn off undo creation, prevent updating the grid GetParam()->EnableUndo(FALSE); BOOL bOldLock = LockUpdate(TRUE); // specify the dimension of the grid // fill cell values |
|||
CString str; double d; CGXStyle style; SetValueRange(CGXRange(nRow, 1), str); // string // you can also use SetStyleRange to apply values // apply a value together with text color |
|||
.SetTextColor(RGB(255, 0, 0)); |
|||
}
// enable updating the grid and undo creation // Redraw the grid |
See also the 1stGrid tutorial in ogguide.doc.