GrapeCity MultiRow Windows Forms Documentation
SectionIndex Property (HitTestInfo)
Example 


Gets the index of the Section that contains the specified coordinates.
Syntax
Public ReadOnly Property SectionIndex As Integer
Dim instance As HitTestInfo
Dim value As Integer
 
value = instance.SectionIndex
public int SectionIndex {get;}

Property Value

A System.Int32 that indicates the index of the Section in the GcMultiRow that contains the specified coordinates.
Example
The following code example shows how to use GcMultiRow's hit test. If you right-click the ColumnHeaderSection, with the mouse, the clicked cell executes an automatic resize.
void gcMultiRow1_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                HitTestInfo info = gcMultiRow1.HitTest(e.Location);
                if (info.Type == HitTestType.ColumnHeader)
                {
                    //If right click the ColumnHeader, the clicked cell will execute auto fit.
                    this.gcMultiRow1.ColumnHeaders[info.SectionIndex].Cells[info.CellIndex].PerformHorizontalAutoFit();
                }
                label.Text = info.ToString();
            }
        }
Private Sub gcMultiRow1_MouseClick(ByVal sender As Object, ByVal e As MouseEventArgs) Handles gcMultiRow1.MouseClick
        If e.Button = MouseButtons.Right Then
            Dim info As HitTestInfo = gcMultiRow1.HitTest(e.Location)
            If info.Type = HitTestType.ColumnHeader Then
                'If right click the ColumnHeader, the clicked cell will execute auto fit.
                Me.gcMultiRow1.ColumnHeaders(info.SectionIndex).Cells(info.CellIndex).PerformHorizontalAutoFit()
            End If
            label.Text = info.ToString()
        End If
    End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

HitTestInfo Class
HitTestInfo Members

 

 


Copyright © GrapeCity, inc. All rights reserved.