Spread Silverlight Documentation
GrapeCity.Windows.SpreadSheet.Data Namespace / Worksheet Class / DataAutoHeadings Property
Example


In This Topic
    DataAutoHeadings Property
    In This Topic
    Gets or sets whether to automatically generate column names for a sheet based on the data source.
    Syntax
    'Declaration
     
    <DefaultValueAttribute(True)>
    Public Property DataAutoHeadings As Boolean
    'Usage
     
    Dim instance As Worksheet
    Dim value As Boolean
     
    instance.DataAutoHeadings = value
     
    value = instance.DataAutoHeadings
    [DefaultValue(true)]
    public bool DataAutoHeadings {get; set;}

    Property Value

    Boolean: true to automatically generate column names; otherwise, false.
    Example
    This example uses the DataAutoHeadings property.
    public class lname
            {
                public string last { get; set; }
                public int val { get; set; }
                public lname(string last, int val)
                {
                    this.last = last;
                    this.val = val;
                }
            }
    
                lname[] arr = new lname[] { new lname("Smith", 100), new lname("Fender", 3), new lname("Gill", 5) };
                gcSpreadSheet1.Sheets[0].DataSource = arr;
                gcSpreadSheet1.Sheets[0].DataAutoHeadings = false;
    Public Class lname
        Public Property last() As String
            Get
                Return m_last
            End Get
            Set
                m_last = Value
            End Set
        End Property
        Private m_last As String
        Public Property val() As Integer
            Get
                Return m_val
            End Get
            Set
                m_val = Value
            End Set
        End Property
        Private m_val As Integer
        Public Sub New(last As String, val As Integer)
            Me.last = last
            Me.val = val
        End Sub
    End Class
    
    Dim arr As lname() = New lname() {New lname("Smith", 100), New lname("Fender", 3), New lname("Gill", 5)}
    GcSpreadSheet1.Sheets(0).DataSource = arr
    GcSpreadSheet1.Sheets(0).DataAutoHeadings = False
    See Also