Spread Silverlight Documentation
GetColumnDataType Method (Worksheet)
Example 


GrapeCity.Windows.SpreadSheet.Data Namespace > Worksheet Class : GetColumnDataType Method
The column index for which the type is requested.
Gets the column data type at the specified position.
Syntax
'Declaration
 
Public Function GetColumnDataType( _
   ByVal column As System.Integer _
) As System.Type
'Usage
 
Dim instance As Worksheet
Dim column As System.Integer
Dim value As System.Type
 
value = instance.GetColumnDataType(column)
public System.Type GetColumnDataType( 
   System.int column
)

Parameters

column
The column index for which the type is requested.

Return Value

Returns the column type for data binding.
Exceptions
ExceptionDescription
Specified index is out of range; must be between 0 and the total number of columns.
Example
This example uses the GetColumnDataType method.
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].BindDataColumn(1, "last");
GcSpreadSheet1.Sheets[0].BindDataColumn(0, "val");
TextBox1.Text = GcSpreadSheet1.Sheets[0].GetColumnDataType(0).ToString();
Public Class lname
        Public Property last() As String
            Get
                Return m_last
            End Get
            Set(value As String)
                m_last = Value
            End Set
        End Property
        Private m_last As String
        Public Property val() As Integer
            Get
                Return m_val
            End Get
            Set(value As Integer)
                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).BindDataColumn(1, "last")
GcSpreadSheet1.Sheets(0).BindDataColumn(0, "val")
TextBox1.Text = GcSpreadSheet1.Sheets(0).GetColumnDataType(0).ToString
See Also

Reference

Worksheet Class
Worksheet Members