void gcMultiRow1_CellMouseDown(object sender, CellMouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
if (e.Scope == CellScope.Row && gcMultiRow1.Template.Row.Cells[e.CellIndex].Selectable)
{
gcMultiRow1.CurrentCellPosition = new CellPosition(e.Scope, e.SectionIndex, e.CellIndex);
}
if (gcMultiRow1.GetValue(e.SectionIndex, e.CellIndex) != null)
{
cut.Enabled = true;
copy.Enabled = true;
}
else
{
cut.Enabled = false;
copy.Enabled = false;
}
if (e.Scope == CellScope.Row && e.SectionIndex != gcMultiRow1.RowCount - 1)
{
sectionMenuStrip.Enabled = true;
sectionMenuStrip.Tag = new CellPosition(e.Scope, e.SectionIndex, e.CellIndex);
}
else
{
sectionMenuStrip.Enabled = false;
}
if (Clipboard.ContainsText())
{
paste.Enabled = true;
}
else
{
paste.Enabled = false;
}
}
}
Private Sub gcMultiRow1_CellMouseDown(ByVal sender As Object, ByVal e As CellMouseEventArgs) Handles gcMultiRow1.CellMouseDown
If e.Button = MouseButtons.Right Then
If e.Scope = CellScope.Row AndAlso gcMultiRow1.Template.Row.Cells(e.CellIndex).Selectable Then
gcMultiRow1.CurrentCellPosition = New CellPosition(e.Scope, e.SectionIndex, e.CellIndex)
End If
If gcMultiRow1.GetValue(e.SectionIndex, e.CellIndex) <> Nothing Then
cut.Enabled = True
copy.Enabled = True
Else
cut.Enabled = False
copy.Enabled = False
End If
If e.Scope = CellScope.Row AndAlso e.SectionIndex <> gcMultiRow1.RowCount - 1 Then
sectionMenuStrip.Enabled = True
sectionMenuStrip.Tag = New CellPosition(e.Scope, e.SectionIndex, e.CellIndex)
Else
sectionMenuStrip.Enabled = False
End If
If Clipboard.ContainsText() Then
paste.Enabled = True
Else
paste.Enabled = False
End If
End If
End Sub