Class TableConditionalFormattingStyles
Represents a collection of special formatting TableConditionalFormattingStyle applied to specified areas of a table.
Inheritance
System.Object
TableConditionalFormattingStyles
Namespace: Syncfusion.Windows.Controls.RichTextBoxAdv
Assembly: Syncfusion.SfRichTextBoxAdv.WPF.dll
Syntax
public class TableConditionalFormattingStyles : ObservableCollection<TableConditionalFormattingStyle>
Constructors
TableConditionalFormattingStyles(BaseNode)
Initializes a new instance of the TableConditionalFormattingStyles class for the specified BaseNode.
Declaration
public TableConditionalFormattingStyles(BaseNode owner)
Parameters
Type | Name | Description |
---|---|---|
BaseNode | owner | The owner for the TableConditionalFormattingStyles. |
Examples
The following code example demonstrates how to create and add new conditional formatting style.
TableStyle tableStyle = new TableStyle(richtextbox.Document);
tableStyle.Name = "MyStyle";
//Create heading row conditional style
TableConditionalFormattingStyle tableConditionalFormattingStyle = new TableConditionalFormattingStyle(richtextbox.Document);
//Create table conditional formatting style for first row
tableConditionalFormattingStyle.TableConditionalFormattingType = TableConditionalFormattingType.FirstRow;
//Set cell format property
tableConditionalFormattingStyle.CellFormat.Shading.BackgroundColor = Colors.LightBlue;
//Set character format property
tableConditionalFormattingStyle.CharacterFormat.Bold = true;
tableConditionalFormattingStyle.CharacterFormat.Underline = Syncfusion.Windows.Controls.RichTextBoxAdv.Underline.Dash;
//Set paragraph format property
tableConditionalFormattingStyle.ParagraphFormat.TextAlignment = TextAlignment.Right;
//Add the first row conditional style in table conditional formatting style collection
tableStyle.TableConditionalFormattingStyles.Add(tableConditionalFormattingStyle);
//Add the table style in document styles collection
richtextbox.Document.Styles.Add(tableStyle);
Private Sub SurroundingSub()
Dim tableStyle As TableStyle = New TableStyle(richtextbox.Document)
tableStyle.Name = "MyStyle"
Dim tableConditionalFormattingStyle As TableConditionalFormattingStyle = New TableConditionalFormattingStyle(richtextbox.Document)
tableConditionalFormattingStyle.TableConditionalFormattingType = TableConditionalFormattingType.FirstRow
tableConditionalFormattingStyle.CellFormat.Shading.BackgroundColor = Colors.LightBlue
tableConditionalFormattingStyle.CharacterFormat.Bold = True
tableConditionalFormattingStyle.CharacterFormat.Underline = Syncfusion.Windows.Controls.RichTextBoxAdv.Underline.Dash
tableConditionalFormattingStyle.ParagraphFormat.TextAlignment = TextAlignment.Right
tableStyle.TableConditionalFormattingStyles.Add(tableConditionalFormattingStyle)
richtextbox.Document.Styles.Add(tableStyle)
End Sub
TableConditionalFormattingStyles(BaseNode, IEnumerable<TableConditionalFormattingStyle>)
Initializes a new instance of the TableConditionalFormattingStyles for the specified collection
for the specified DocumentStyle.
Declaration
public TableConditionalFormattingStyles(BaseNode owner, IEnumerable<TableConditionalFormattingStyle> collection)
Parameters
Type | Name | Description |
---|---|---|
BaseNode | owner | The owner for the TableConditionalFormattingStyles. |
System.Collections.Generic.IEnumerable<TableConditionalFormattingStyle> | collection | The collection of TableConditionalFormattingStyle. |
Examples
The following code example demonstrates how to create and add a conditional formatting style.
TableStyle tableStyle = new TableStyle(richtextbox.Document);
tableStyle.Name = "MyStyle";
//Create heading row conditional style
TableConditionalFormattingStyle tableConditionalFormattingStyle = new TableConditionalFormattingStyle(richtextbox.Document);
//Create table conditional formatting style for first row
tableConditionalFormattingStyle.TableConditionalFormattingType = TableConditionalFormattingType.FirstRow;
//Set cell format property
tableConditionalFormattingStyle.CellFormat.Shading.BackgroundColor = Colors.LightBlue;
//Set character format property
tableConditionalFormattingStyle.CharacterFormat.Bold = true;
tableConditionalFormattingStyle.CharacterFormat.Underline = Syncfusion.Windows.Controls.RichTextBoxAdv.Underline.Dash;
//Set paragraph format property
tableConditionalFormattingStyle.ParagraphFormat.TextAlignment = TextAlignment.Right;
//Add the first row conditional style in table conditional formatting style collection
tableStyle.TableConditionalFormattingStyles.Add(tableConditionalFormattingStyle);
//Add the table style in document styles collection
richtextbox.Document.Styles.Add(tableStyle);
Private Sub SurroundingSub()
Dim tableStyle As TableStyle = New TableStyle(richtextbox.Document)
tableStyle.Name = "MyStyle"
Dim tableConditionalFormattingStyle As TableConditionalFormattingStyle = New TableConditionalFormattingStyle(richtextbox.Document)
tableConditionalFormattingStyle.TableConditionalFormattingType = TableConditionalFormattingType.FirstRow
tableConditionalFormattingStyle.CellFormat.Shading.BackgroundColor = Colors.LightBlue
tableConditionalFormattingStyle.CharacterFormat.Bold = True
tableConditionalFormattingStyle.CharacterFormat.Underline = Syncfusion.Windows.Controls.RichTextBoxAdv.Underline.Dash
tableConditionalFormattingStyle.ParagraphFormat.TextAlignment = TextAlignment.Right
tableStyle.TableConditionalFormattingStyles.Add(tableConditionalFormattingStyle)
richtextbox.Document.Styles.Add(tableStyle)
End Sub