Table Style Dialog
- 2 minutes to read
The Table Styles (Create New Style from Formatting or Modify Style) dialog enables end-users to create a new table style or modify an existing one. The style settings can be applied to the whole table or a specific element: header or total row, first column, last column, banded rows or columns (odd and even); top right, top left, bottom right or bottom left cell.
End-users can invoke this dialog using the Table Style gallery of the Table Tools | Design ribbon tab. Right-click the target table style in the gallery and select New Style... or Modify Style...
...or select the corresponding gallery menu item. Refer to the How to: Create the RichEditControl with a Ribbon UI topic for details on how to provide a ribbon UI for the RichEditControl. Executing the ShowTableStyleFormCommand command invokes this dialog as well.
End-users can select the style to be modified from the Current Style: list. The Name box allows you to change the name of the current table style.
The target style can be based on any other available style. Select the base style from the Style based on: list.
In the dialog's Formatting section, end-users can change table cells' appearance (borders visibility, color and thickness) and content (font, size, style and alignment). Select the particular element to which new style options should be applied from the Apply formatting to: list.
When a table style is applied to a particular table, not all style elements are applied. End-users can use the Table Style Options group in the ribbon UI to determine which table elements are formatted with the applied style.
To customize the default Modify Style dialog (change captions, set default dialog values, implement custom validation, etc.) or replace it with a completely new dialog, handle the RichEditControl.TableStyleFormShowing event. To see an example of dialog replacement, refer to the How to: Customize the Search Form document.