/// <summary> /// Main method to initialise the grid and label on a specified tab /// </summary> /// <param name="ATableName"></param> /// <param name="AGrid"></param> /// <param name="ADescriptionLabel"></param> private void InitialiseTab(KeyboardShortcutTableNames ATableName, TSgrdDataGrid AGrid, Label ADescriptionLabel) { if (AGrid == null) { // The grid has already been initialised so we have nothing to do return; } ADescriptionLabel.AutoSize = false; ADescriptionLabel.Width = this.Width - 40; ADescriptionLabel.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; switch (ATableName) { case KeyboardShortcutTableNames.General: ADescriptionLabel.Text = ApplWideResourcestrings.StrKeysHelpCategoryGeneral; break; case KeyboardShortcutTableNames.List: ADescriptionLabel.Text = ApplWideResourcestrings.StrKeysHelpCategoryList; break; case KeyboardShortcutTableNames.Navigation: ADescriptionLabel.Text = ApplWideResourcestrings.StrKeysHelpCategoryNavigation; break; case KeyboardShortcutTableNames.FilterFind: ADescriptionLabel.Text = ApplWideResourcestrings.StrKeysHelpCategoryFilterFind; break; case KeyboardShortcutTableNames.PartnerEditContactDetailsTab: ADescriptionLabel.Text = Catalog.GetString( "These keyboard shortcuts are specific to the Partner Edit screens' Contact Details Tab. Use them to " + "speed up entry of new Contact Detail records or to send E-mails conveniently."); break; } DataTable table = FMainDS.Tables[ATableName.ToString()]; AGrid.AddTextColumn(FColumnNames[0], table.Columns[0], 100); AGrid.AddTextColumn(FColumnNames[1], table.Columns[1], 250); AGrid.AutoStretchColumnsToFitWidth = true; AGrid.Columns[0].AutoSizeMode = SourceGrid.AutoSizeMode.None; AGrid.Columns[1].AutoSizeMode = SourceGrid.AutoSizeMode.EnableStretch | SourceGrid.AutoSizeMode.EnableAutoSize; table.DefaultView.AllowNew = false; AGrid.DataSource = new DevAge.ComponentModel.BoundDataView(table.DefaultView); AGrid.AutoSizeCells(new SourceGrid.Range(1, 1, AGrid.Rows.Count - 1, 1)); // We need this line, otherwise the Enter key locks up the screen. For this grid, on a dialog, we have no special keys. AGrid.SpecialKeys = SourceGrid.GridSpecialKeys.None; }
/// <summary> /// Main method to initialise the grid and label on a specified tab /// </summary> /// <param name="ATableName"></param> /// <param name="AGrid"></param> /// <param name="ADescriptionLabel"></param> private void InitialiseTab(KeyboardShortcutTableNames ATableName, TSgrdDataGrid AGrid, Label ADescriptionLabel) { if (AGrid == null) { // The grid has already been initialised so we have nothing to do return; } ADescriptionLabel.AutoSize = false; ADescriptionLabel.Width = this.Width - 40; ADescriptionLabel.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; switch (ATableName) { case KeyboardShortcutTableNames.General: ADescriptionLabel.Text = ApplWideResourcestrings.StrKeysHelpCategoryGeneral; break; case KeyboardShortcutTableNames.List: ADescriptionLabel.Text = ApplWideResourcestrings.StrKeysHelpCategoryList; break; case KeyboardShortcutTableNames.Navigation: ADescriptionLabel.Text = ApplWideResourcestrings.StrKeysHelpCategoryNavigation; break; case KeyboardShortcutTableNames.FilterFind: ADescriptionLabel.Text = ApplWideResourcestrings.StrKeysHelpCategoryFilterFind; break; } DataTable table = FMainDS.Tables[ATableName.ToString()]; AGrid.AddTextColumn(FColumnNames[0], table.Columns[0], 100); AGrid.AddTextColumn(FColumnNames[1], table.Columns[1], 250); AGrid.AutoStretchColumnsToFitWidth = true; AGrid.Columns[0].AutoSizeMode = SourceGrid.AutoSizeMode.None; AGrid.Columns[1].AutoSizeMode = SourceGrid.AutoSizeMode.EnableStretch | SourceGrid.AutoSizeMode.EnableAutoSize; table.DefaultView.AllowNew = false; AGrid.DataSource = new DevAge.ComponentModel.BoundDataView(table.DefaultView); AGrid.AutoSizeCells(new SourceGrid.Range(1, 1, AGrid.Rows.Count - 1, 1)); // We need this line, otherwise the Enter key locks up the screen. For this grid, on a dialog, we have no special keys. AGrid.SpecialKeys = SourceGrid.GridSpecialKeys.None; }
/// <summary> /// Main method to initialise the grid and label on a specified tab /// </summary> /// <param name="ATableName"></param> /// <param name="AGrid"></param> /// <param name="ADescriptionLabel"></param> private void InitialiseTab(KeyboardShortcutTableNames ATableName, TSgrdDataGrid AGrid, Label ADescriptionLabel) { if (AGrid == null) { // The grid has already been initialised so we have nothing to do return; } switch (ATableName) { case KeyboardShortcutTableNames.General: ADescriptionLabel.Text = ApplWideResourcestrings.StrKeysHelpCategoryGeneral; break; case KeyboardShortcutTableNames.List: ADescriptionLabel.Text = ApplWideResourcestrings.StrKeysHelpCategoryList; break; case KeyboardShortcutTableNames.Navigation: ADescriptionLabel.Text = ApplWideResourcestrings.StrKeysHelpCategoryNavigation; break; case KeyboardShortcutTableNames.FilterFind: ADescriptionLabel.Text = ApplWideResourcestrings.StrKeysHelpCategoryFilterFind; break; case KeyboardShortcutTableNames.Dates: ADescriptionLabel.Text = Catalog.GetString( "These keyboard shortcuts apply anywhere where a date is required. Dates can be entered as displayed " + "or can be typed in one of the following ways, for example as digits only or as a number of days from today."); break; case KeyboardShortcutTableNames.MainMenu: ADescriptionLabel.Text = Catalog.GetString( "The Main Menu screen lists Modules at the lower left, Sub-Modules at the upper left and " + "Task Items divided into Task Groups on the right side of the screen. The shortcuts listed here allow you to quickly change " + "Module, Sub-Module or Task and to launch the selected Task."); break; case KeyboardShortcutTableNames.PartnerEditContactDetailsTab: ADescriptionLabel.Text = Catalog.GetString( "These keyboard shortcuts are specific to the Partner Edit screens' Contact Details Tab. Use them to " + "speed up entry of new Contact Detail records or to send E-mails conveniently."); break; } DataTable table = FMainDS.Tables[ATableName.ToString()]; AGrid.AddTextColumn(FColumnNames[0], table.Columns[0], 130); AGrid.AddTextColumn(FColumnNames[1], table.Columns[1], 250); AGrid.AutoStretchColumnsToFitWidth = true; AGrid.Columns[0].AutoSizeMode = SourceGrid.AutoSizeMode.None; AGrid.Columns[1].AutoSizeMode = SourceGrid.AutoSizeMode.EnableStretch | SourceGrid.AutoSizeMode.EnableAutoSize; table.DefaultView.AllowNew = false; AGrid.DataSource = new DevAge.ComponentModel.BoundDataView(table.DefaultView); AGrid.AutoSizeCells(new SourceGrid.Range(1, 1, AGrid.Rows.Count - 1, 1)); // We need this line, otherwise the Enter key locks up the screen. For this grid, on a dialog, we have no special keys. AGrid.SpecialKeys = SourceGrid.GridSpecialKeys.None; }