Spread ASP.NET 15
FarPoint.Web.Spread Assembly / FarPoint.Web.Spread.Model Namespace / GroupDataModel Class / GetColumnName Method
Column index
Example


In This Topic
    GetColumnName Method (GroupDataModel)
    In This Topic
    Gets the name of the specified column in the group.
    Syntax
    'Declaration
     
    Public Function GetColumnName( _
       ByVal column As Integer _
    ) As String
    'Usage
     
    Dim instance As GroupDataModel
    Dim column As Integer
    Dim value As String
     
    value = instance.GetColumnName(column)
    public string GetColumnName( 
       int column
    )

    Parameters

    column
    Column index

    Return Value

    String containing the name
    Example
    This example returns the name of the column from the specified index.
    protected void Button1_Click(object sender, EventArgs e)
    {
    FarPoint.Web.Spread.Model.GroupDataModel gm;
    if ((FpSpread1.ActiveSheetView.DataModel) is FarPoint.Web.Spread.Model.GroupDataModel)
    {
    gm = (FarPoint.Web.Spread.Model.GroupDataModel)FpSpread1.ActiveSheetView.DataModel;
    if ((gm.TargetModel) is FarPoint.Web.Spread.Model.IRangeSupport)
    {
    FarPoint.Web.Spread.Model.IRangeSupport im = (FarPoint.Web.Spread.Model.IRangeSupport)gm.TargetModel;
    bool b;
    b = gm.IsGroup(0);
    string s = gm.GetColumnName(2);
    String msg = s;
    Response.Write("alert('" + msg + "')");
    }
    }
    }
    
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim gm As FarPoint.Web.Spread.Model.GroupDataModel
    If TypeOf (FpSpread1.ActiveSheetView.DataModel) Is FarPoint.Web.Spread.Model.GroupDataModel Then
    gm = FpSpread1.ActiveSheetView.DataModel
    If TypeOf (gm.TargetModel) Is FarPoint.Web.Spread.Model.IRangeSupport Then
    Dim im As FarPoint.Web.Spread.Model.IRangeSupport = gm.TargetModel
    Dim b As Boolean
    b = gm.IsGroup(0)
    Dim s As String = gm.GetColumnName(2)
    Dim msg As String = s
    Response.Write("alert('" & msg & "')")
    End If
    End If
    End Sub
    
    See Also