GrapeCity MultiRow Windows Forms Documentation
Type Property (HitTestInfo)
Example 


Gets a value that indicates which part of the GcMultiRow is located in the specified coordinates.
Syntax
Public ReadOnly Property Type As HitTestType
Dim instance As HitTestInfo
Dim value As HitTestType
 
value = instance.Type
public HitTestType Type {get;}

Property Value

One of the HitTestType values that indicates which part of the GcMultiRow is located in 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 fit.
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.