static void EmbeddedNavigator_MouseHover(object sender, EventArgs e) { GridControlNavigator n = sender as GridControlNavigator; GridControl gc = n.Parent as GridControl; ((GridView)gc.FocusedView).OptionsBehavior.Editable = true; }
private void gdcMaterial_EmbeddedNavigator_ButtonClick(object sender, NavigatorButtonClickEventArgs e) { try { GridControlNavigator nav = (GridControlNavigator)sender; GridControl grid = (GridControl)nav.NavigatableControl; GridView view = (GridView)grid.FocusedView; switch (e.Button.ButtonType) { case NavigatorButtonType.Remove: if (MessageBox.Show("Do you want to delete the current row?", "Confirm deletion", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes) { if (gdcMaterialCategory.FocusedView.Name == "gdvCategory") { new TIS.BL.Internal.MaterialCategory().Remove((MaterialCategoryObject)view.GetRow(view.FocusedRowHandle)); e.Handled = false; } if (gdcMaterialCategory.FocusedView.Name == "gdvType") { new TIS.BL.Internal.MaterialType().Remove((MaterialTypeObject)view.GetRow(view.FocusedRowHandle)); e.Handled = false; } if (gdcMaterialCategory.FocusedView.Name == "gdvSubTypes") { new TIS.BL.Internal.MaterialSubType().Remove((MaterialSubTypeObject)view.GetRow(view.FocusedRowHandle)); e.Handled = false; } } else if (e != null) { e.Handled = true; } break; } } catch (System.Exception exception1) { e.Handled = true; System.Exception thisException = exception1; Management.ShowException(thisException); } }