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