This topic discusses about various operations that require handling at the grid level.
Transposing data refers to swapping column data and row data. In WinForms FlexGrid, this can be achieved using Transpose() method of the C1FlexGrid class as shown in the code below.
Note that data can be transposed only in the case of unbound grid. Also, if grid has sorting applied on a column, the Transpose() method removes sorting before transposing the data.
Context menus can be helpful to user as they provide shortcuts for actions that are frequently used. In FlexGrid, there can be two scenarios to display a context menu.
To display context menu when grid is in non-edit mode, you need to create an instance of ContextMenuStrip control, add the menu items and assign the instance to ContextMenuStrip property of the Control class.
Refer to the code below to see how to display a context menu in WinForms FlexGrid in non-edit mode.
To display context menu in edit mode, you need to display the context menu on editor by using StartEdit event of the C1FlexGrid class. In the StartEdit event, instantiate the editor and the ContextMenuStrip, add menu items and then assign it to ContextMenuStrip property of the editor.
Use the code below to display context menu in WinForms FlexGrid in edit mode.