Row detail is a feature to provide additional information related to a row or record in the form of another expandable layer. In such case, row which is the first layer contains the basic information, while the second layer contains the detailed information. This feature is specially useful when the additional information is too large to be displayed in the available screen space or it is not consistent for every record.
FlexGrid provides the row detail feature using IC1FlexGridRowDetail interface which is implemented by the detail controls to be hosted on detail row. In addition, FlexGrid also provides a separate assembly C1.Win.C1FlexGrid.RowDetails to provide template user controls, InputPanel and FlexGrid, ready to be used in detail row. You can add details section to any row in FlexGrid, which enables you to group data in a template which is visible optionally. This allows users to view additional data related to a row by simply selecting the row. The grid also provides built-in expand or collapse buttons to control the visibility of data within the expandable row.
Some common use case scenarios of row detail feature are:
Detailed implementation of these scenarios is given in their respective sections below.
FlexGrid supports in-form editing by hosting InputPanel control in detail row. The InputPanel control contains data fields where user can enter or edit the values like a form. Once user finishes editing fields, those values get reflected in the selected row.
In FlexGrid, you can implement in-form editing by adding reference to C1.Win.C1FlexGrid.RowDetails and using the C1InputPanelRowDetail class which already implements the IC1FlexGridRowDetail interface. The instance of this class is then assigned to RowDetailProvider property of the C1FlexGrid class which adds the InputPanel control to detail row and enables the in-form editing.
Hierarchical view refers to master-detail model where top level grid is the 'master grid' and nested grid is the 'detail grid' which displays additional information about expanded row of the master grid. For instance, example below demonstrates the master-detail structure using Customer and Order tables respectively with CustomerID as common data element to define a relation.
In FlexGrid, you can implement hierarchical grid by adding reference to C1.Win.C1FlexGrid.RowDetails.4.5.2.dll and using the C1FlexGridRowDetail class which already implements the IC1FlexGridRowDetail interface. The instance of this class is then assigned to RowDetailProvider property of the C1FlexGrid class to nest another grid in the detail row which enables the hierarchical grid interface.
In addition to the InputPanel and FlexGrid control, you can also host a custom control in the detail row of a grid. For instance, in the example below, a text label control is attached to the row to enlist the additional information without affecting the dimensions of the grid.
To implement the custom row details in FlexGrid, you need to create a user control which implements the IC1FlexGridRowDetail interface. For instance, here we have created a class named CustomRowDetail which represents the text label control to be hosted in the detail row. You then need to assign an object of this class to RowDetailProvider property of the C1FlexGrid class to enable the custom control to display additional information in the detail row.