menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DataFormDisplayOptionsAttribute - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class DataFormDisplayOptionsAttribute

    Provides attribute-based display configuration options for fields in the SfDataForm component, enabling enhanced layout customization and editor arrangement.

    Inheritance
    System.Object
    DataFormDisplayOptionsAttribute
    Namespace: Syncfusion.Blazor.DataForm
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public sealed class DataFormDisplayOptionsAttribute : Attribute
    Remarks

    Use the DataFormDisplayOptionsAttribute to designate specific display preferences for fields generated within the SfDataForm. It is most commonly applied to model properties for fine-grained control of data form layouts.

    Examples

    The following example demonstrates how to apply the DataFormDisplayOptionsAttribute to a model property for column spanning.

    public class Employee
    {
        [DataFormDisplayOptions(ColumnSpan = 2)]
        public DateTime HireDate { get; set; }
    }

    Constructors

    DataFormDisplayOptionsAttribute()

    Declaration
    public DataFormDisplayOptionsAttribute()

    Properties

    ColumnSpan

    Gets or sets the column span that indicates how many columns a field editor should occupy within the form layout in the SfDataForm component.

    Declaration
    public int ColumnSpan { get; set; }
    Property Value
    Type Description
    System.Int32

    An int representing the number of columns to span the respective field editor. The default is 1.

    Remarks

    This property is particularly useful in auto-generated forms when fields should cover multiple columns within column-based layouts. Applying ColumnSpan ensures the respective field will visually expand across the desired number of columns.

    Usage Example:

    [DataFormDisplayOptions(ColumnSpan = 2)]
    public DateTime DateTimeValue { get; set; }
    When both the ColumnSpan property of the DataFormDisplayOptionsAttribute and the ColumnSpan property of the SfDataForm component are specified, the attribute value on the property takes precedence.
    Examples

    This example shows how to set the column span for a date field:

    [DataFormDisplayOptions(ColumnSpan = 2)]
    public DateTime DateOfBirth { get; set; }
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved