This sample illustrates the implementation of multiple row and column headers in a GridDataBoundGrid (GDBG) and the addition of unbound rows or columns as well.
A couple of fixed rows at the top of the grid that show a variety of controls such as combo boxes, drop-down lists, check boxes, and buttons are shown in this sample. There is also an unbound check box column displayed on the left side of the grid that affects the display of the values in that row.
Features:
Additional row headers can be added below the existing header by setting Model.Rows.HeaderCount. These additional headers do not move by setting Model.Rows.FrozenCount, if the user scrolls the grid.
Model.CoveredRanges is used to cover cells and display them as a group.
Styles applied in the grid can be set using the ChangeCells for a range and by passing the GridStyleInfo object.
When an instance of GridBoundColumn is added to GridBoundColumnsCollection, it creates an unbound column at the end.
To move a column to a different position, Model.Cols.MoveRange is used. With the function NameToColIndex, the index of the column can be obtained by passing the column name.
A bound column has its own data store to store the values that are entered in it. But in an unbound column there is no data store present, so it has to be handled manually by adding a collection like a hash table. To make an unbound column work together, you must assign a key as the corresponding primary key value in the row in the Key/Value external collection.
The Model.QueryCellInfo event is used to display the values. The Model.SaveCellInfo event is used to save changes that are made by the user in a column.
To make the black triangle at the row header travel with the current cell, GridBinder.CurrentPosition should be set in the CurrentCellChanged event.
Use the ScrollTipFeedback handler to synchronize ScrollTips with data content in the table to give feedback when scrolling.