private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
{
// get selected row and decide what to show/not to show
Point p = gridControl1.PointToClient(Cursor.Position);
GridHitInfo hitinfo = gridView1.CalcHitInfo(p);
int[] selectedrows = gridView1.GetSelectedRows();
if (hitinfo.InRow)
{
int grouplevel = gridView1.GetRowLevel((int)selectedrows.GetValue(0));
if (grouplevel >= gridView1.GroupCount)
{
//Console.WriteLine("In row");
if (gridView1.GetFocusedRow() is TransactionEntry)
{
TransactionEntry sh = (TransactionEntry)gridView1.GetFocusedRow();
if (sh.IsRolledBack)
{
rollForwardToolStripMenuItem.Enabled = true;
rolllBackToolStripMenuItem.Enabled = false;
}
else
{
rollForwardToolStripMenuItem.Enabled = false;
rolllBackToolStripMenuItem.Enabled = true;
}
}
}
}
}