ComponentOne grids are relied upon by banks and other financial institutions for high-performance, high-throughput data visualization and manipulation. In some financial applications it becomes necessary to merge cells, similar in functionality to popular spreadsheet applications, in order to enable the user to work with data in a form-like fashion. The FlexGrid control can be customized to meet any cell merging requirements. The following samples describe various methods for merging FlexGrid cells. 1. The C1FlexGrid control offers several built-in merging modes (free, spill, nodes, row/col control, etc). But there are some limitations. For example, none of the built-in modes allows you to create merged ranges that span both rows and columns. This sample shows how you can overcome this limitation by inheriting from the C1FlexGrid and implementing a custom version of the virtual GetMergeRange method. 2. This sample shows grids with merged column headers, cells that spill into adjacent empty cells, and regular merging based on cell contents.
3. The C1FlexGrid control offers several built-in merging modes (free, spill, nodes, row/col control, etc). But there are some limitations. For example, none of the built-in modes allows you to create merged ranges that span both rows and columns. This sample shows how you can overcome this limitation by inheriting from the C1FlexGrid and implementing a custom version of the virtual GetMergeRange method.
4. You can override the GetMergedRange method to customize grouping. But in some cases you may want to use the default merging logic, except based on arbitrary data (rather than on the actual cell contents). This sample shows how you can override both GetMergedRange and GetData, and have GetData provide your custom data while the grid is calculating the merged ranges.
5. By default, the grid sorts the actual data, not the display value. This sample shows how you can override this behavior and sort by customer name rather than customer ID (for example).
Note: All samples were pulled from our extensive sample library, which features hundreds more samples like these to speed up your development process.