[C#]
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
private void gridView1_ShowGridMenu(object sender,DevExpress.XtraGrid.Views.Grid.GridMenuEventArgs e) {
GridView view = sender as GridView;
GridHitInfo hitInfo = view.CalcHitInfo(e.Point);
if(hitInfo.InRow) {
view.FocusedRowHandle = hitInfo.RowHandle;
ContextMenu1.Show(view.GridControl, e.Point);
}
}
[VB.NET]
Imports DevExpress.XtraGrid.Views.Grid
Private Sub GridView1_ShowGridMenu(ByVal sender As Object, ByVal e As
DevExpress.XtraGrid.Views.Grid.GridMenuEventArgs) Handles GridView1.ShowGridMenu
Dim View As GridView = CType(sender, GridView)
Dim HitInfo As ViewInfo.GridHitInfo
HitInfo = View.CalcHitInfo(e.Point)
If HitInfo.InRow Then
View.FocusedRowHandle = HitInfo.RowHandle
ContextMenu1.Show(View.GridControl, e.Point)
End If
End Sub
Attachments
0 komentar:
Posting Komentar