FormatConditionBase.PredefinedFormatName Property

Gets or sets the name of the predefined format to be applied to the cells. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v20.1.Core.dll

Declaration

public string PredefinedFormatName { get; set; }
Public Property PredefinedFormatName As String

Property Value

Type Description
String

A String value that is the predefined format name.

Remarks

The table below presents the collections that store predefined formats.

Conditional Format Predefined Formats Collection
Basic conditional formats TableView.PredefinedFormats (TreeListView.PredefinedFormats)
Data Update TableView.PredefinedFormats (TreeListView.PredefinedFormats)
Icon Sets TableView.PredefinedIconSetFormats (TreeListView.PredefinedIconSetFormats)
Color Scales TableView.PredefinedColorScaleFormats (TreeListView.PredefinedColorScaleFormats)
Data Bars TableView.PredefinedDataBarFormats (TreeListView.PredefinedDataBarFormats)

You cannot modify a predefined format collection. To define a new predefined format, create a new predefined format collection.

The following code sample illustrates how to create a collection of predefined formats in markup:

<dxg:TableView AllowConditionalFormattingMenu="True">
   <dxg:TableView.PredefinedFormats>
      <dx:FormatInfoCollection>
         <dx:FormatInfo FormatName="PurpleFill" DisplayName="Purple Fill">
            <dx:FormatInfo.Format>
               <dxg:Format Background="Purple"/>
            </dx:FormatInfo.Format>
         </dx:FormatInfo>
      </dx:FormatInfoCollection>
   </dxg:TableView.PredefinedFormats>
   <!----> 
</dxg:TableView>

The code sample below illustrates how to create a collection of predefined formats in code-behind:

FormatInfoCollection predefinedFormats = new FormatInfoCollection();
foreach (FormatInfo formatInfo in view.PredefinedFormats) {
   predefinedFormats.Add(formatInfo);
}
predefinedFormats.Add(new FormatInfo() {
   FormatName = "PurpleFill",
   DisplayName = "Purple Fill",
   Format = new Format() {
      Background = Brushes.Purple
   }
});
view.PredefinedFormats = predefinedFormats;
See Also