private RegionView GetEntityByRowHandle(int rowHandle) { RegionView entity = null; if (gridViewRegions.IsDataRow(rowHandle)) { entity = (RegionView)gridViewRegions.GetRow(rowHandle); } return(entity); }
private void gridControlCountries_MouseDoubleClick(object sender, MouseEventArgs e) { GridHitInfo info = gridViewRegions.CalcHitInfo(e.X, e.Y); if (info.InRowCell && gridViewRegions.IsDataRow(info.RowHandle)) { RegionView entity = GetEntityByRowHandle(info.RowHandle); if (entity != null) { OnEntityDblClick(); if (!ReadOnly) { EditRegion(); } } } }
private void menuRegion_Opening(object sender, CancelEventArgs e) { if (ReadOnly) { e.Cancel = true; return; } RegionView region = FocusedEntity; menuItem_EditRegion.Enabled = region != null; menuItem_RegionDetails.Enabled = region != null; menuItem_GroupByCountry.Checked = GroupByCountry; menuItem_EditRegion.Visible = !ReadOnly; menuItem_RegionDetails.Visible = !ReadOnly; menuItem_ImportRegion.Visible = isUserGlobaAdministrator; separatorMenuItem.Visible = !ReadOnly; }