private void ProductForm_VisibleChanged(object sender, EventArgs e) { if (Visible && productID == -1) { ProductGrid.ClearSelection(); } }
private void SaleItemPopup_Load(object sender, EventArgs e) { Left = MainForm.Location.X + (MainForm.Width / 2 - Width / 2); Top = MainForm.Location.Y + (MainForm.Height / 2 - Height / 2); FilterButton_Click(sender, e); ProductGrid.ClearSelection(); }
private void FilterButton_Click(object sender, EventArgs e) { var filter = new ProductFilter { ID = FilterIDTextBox.Text.AsInt(), Name = FilterNameTextBox.Text, Scale = FilterScaleTextBox.Text.AsShort() }; ProductGrid.DataSource = ProductRepository.GetProducts(filter); ProductGrid.ClearSelection(); }
private void CancelButton_Click(object sender, EventArgs e) { ProductErrorProvider.Clear(); if (productID > 0) { ViewProductDetailTab(productID); } else { ViewProductListingTab(); productID = -1; ProductGrid.ClearSelection(); } }
private void ViewComponentDetailTab(int id) { using (var repository = new ComponentTypeRepository()) { var dropDown = repository.GetComponentTypeForDropDown(); dropDown.Insert(0, new KeyValuePair <byte, string>(0, "<Vytvořit nový typ...>")); ComponentTypeDropDown.DataSource = dropDown; } if (id > 0) { IsWork = false; RibbonMode = RibbonMode.Detail; ChangeControlsEnabled(DetailTab.Controls, false, false); var component = ComponentRepository.GetComponent(componentID); ComponentTypeDropDown.SelectedValue = component.ComponentTypeID; NameTextBox.Text = component.Name.ToString(); ProductGrid.DataSource = ComponentRepository.GetProducts(componentID); ComponentTabControl.SelectedTab = DetailTab; ProductGrid.ClearSelection(); } else { IsWork = true; RibbonMode = RibbonMode.Edit; ChangeControlsEnabled(DetailTab.Controls, true, true); ComponentTabControl.SelectedTab = DetailTab; } }