private void ComponentTypeDropDown_Validating(object sender, System.ComponentModel.CancelEventArgs e) { if (ComponentTypeDropDown.SelectedIndex == -1) { ComponentErrorProvider.SetError(ComponentTypeDropDown, Resources.ValidationMandatory); e.Cancel = true; } else { ComponentErrorProvider.SetError(ComponentTypeDropDown, ""); } }
private void NameTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) { if (NameTextBox.Text.IsNullOrWhiteSpace()) { ComponentErrorProvider.SetError(NameTextBox, Resources.ValidationMandatory); e.Cancel = true; } else if (NameTextBox.Text.Length > 100) { ComponentErrorProvider.SetError(NameTextBox, Resources.ValidationLength.FormatWith(100)); e.Cancel = true; } else { ComponentErrorProvider.SetError(NameTextBox, ""); } }
private void CancelButton_Click(object sender, EventArgs e) { ComponentErrorProvider.Clear(); if (componentID > 0) { ViewComponentDetailTab(componentID); } else { ViewComponentListingTab(); componentID = -1; ComponentGrid.ClearSelection(); } }
private void ComponentTabControl_SelectedIndexChanged(object sender, EventArgs e) { ComponentErrorProvider.Clear(); if (ComponentTabControl.SelectedTab == ListingTab) { RibbonMode = RibbonMode.Listing; } else if (ComponentTabControl.SelectedTab == DetailTab) { if (IsWork) { RibbonMode = RibbonMode.Edit; } else { RibbonMode = RibbonMode.Detail; } } }