Spread ASP.NET 15
FarPoint.Web.Spread Assembly / FarPoint.Web.Spread.Model Namespace / GroupDataModel Class / GetIndex Method
Row index

In This Topic
    GetIndex Method (GroupDataModel)
    In This Topic
    Gets the model index of the group data model from the specified row.
    Public Function GetIndex( _
       ByVal row As Integer _
    ) As Integer
    Dim instance As GroupDataModel
    Dim row As Integer
    Dim value As Integer
    value = instance.GetIndex(row)
    public int GetIndex( 
       int row


    Row index

    Return Value

    Integer index of the row
    This example returns the value 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;
                    int i;
                    i = gm.GetIndex(2);
                    String msg = i.ToString();
                    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 i As Integer
                    i = gm.GetIndex(2)
                    Dim msg As String = i.ToString()
                    Response.Write("alert('" & msg & "')")
            End If
      End If
    End Sub
    See Also