public static void LoadConfirmationPromptGridView(DataGridView gridView, Table table, DataGridView partnerCommandTransitionGridView) { BindingList <ConfirmationPromptRow> cpList = ConfirmationPromptRow.GetRowsFromTable(table); if (gridView.Columns.Count == 0) { gridView.AutoGenerateColumns = false; AddStringComboBoxColumn(gridView, ConfirmationPromptRow.OptionColumnName); gridView.Enter += new EventHandler(EnterConfirmationGridView); AddButtonColumn(gridView, Strings.IndentColumnName, Strings.IndentButtonName); AddTextBoxColumn(gridView, ConfirmationPromptRow.ConditionColumnName); AddButtonColumn(gridView, Strings.OutdentColumnName, Strings.OutdentButtonName); AddTextBoxColumn(gridView, ConfirmationPromptRow.WordingColumnName); AddTextBoxColumn(gridView, ConfirmationPromptRow.IdColumnName); AddTextBoxColumn(gridView, ConfirmationPromptRow.OptionDateStampColumnName); AddTextBoxColumn(gridView, ConfirmationPromptRow.ConditionDateStampColumnName); AddTextBoxColumn(gridView, ConfirmationPromptRow.WordingDateStampColumnName); AddTextBoxColumn(gridView, ConfirmationPromptRow.IdDateStampColumnName); gridView.CellValueChanged -= new DataGridViewCellEventHandler(OnConfirmationPromptCellValueChangedForAutoPromptId); gridView.CellValueChanged += new DataGridViewCellEventHandler(OnConfirmationPromptCellValueChangedForAutoPromptId); ApplyCommonDataGridViewSettings <ConfirmationPromptRow>(gridView, true); HideDateStampColumns(gridView); } // starts us off with the right set of options - we'll add dynamically later if new ones are added in EnterConfirmationGridView //LoadComboBoxColumn(gridView, ConfirmationPromptRow.OptionColumnName, GetConfirmationPromptComboValues(table, (int)TableColumns.CommandTransitions.Option)); //JDK changed in hopes of finding trhe bug - LoadComboBoxColumn(gridView, ConfirmationPromptRow.OptionColumnName, GetConfirmationPromptComboValues(table, (int)TableColumns.ConfirmationPrompts.Option)); gridView.DataSource = cpList; }
public static BindingList <ConfirmationPromptRow> GetRowsFromTable(Table table) { BindingList <ConfirmationPromptRow> list = new BindingList <ConfirmationPromptRow>(); for (int row = 0; row < table.GetNumRows(); row++) { ConfirmationPromptRow cp = new ConfirmationPromptRow(); cp.Option = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Option); cp.Condition = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Condition); cp.Wording = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Wording); cp.Id = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Id); cp.OptionDateStamp = table.GetData(row, (int)TableColumns.ConfirmationPrompts.OptionDateStamp); cp.ConditionDateStamp = table.GetData(row, (int)TableColumns.ConfirmationPrompts.ConditionDateStamp); cp.WordingDateStamp = table.GetData(row, (int)TableColumns.ConfirmationPrompts.WordingDateStamp); cp.IdDateStamp = table.GetData(row, (int)TableColumns.ConfirmationPrompts.IdDateStamp); list.Add(cp); } return(list); }
public static BindingList<ConfirmationPromptRow> GetRowsFromTable(Table table) { BindingList<ConfirmationPromptRow> list = new BindingList<ConfirmationPromptRow>(); for (int row = 0; row < table.GetNumRows(); row++) { ConfirmationPromptRow cp = new ConfirmationPromptRow(); cp.Option = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Option); cp.Condition = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Condition); cp.Wording = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Wording); cp.Id = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Id); cp.OptionDateStamp = table.GetData(row, (int)TableColumns.ConfirmationPrompts.OptionDateStamp); cp.ConditionDateStamp = table.GetData(row, (int)TableColumns.ConfirmationPrompts.ConditionDateStamp); cp.WordingDateStamp = table.GetData(row, (int)TableColumns.ConfirmationPrompts.WordingDateStamp); cp.IdDateStamp = table.GetData(row, (int)TableColumns.ConfirmationPrompts.IdDateStamp); list.Add(cp); } return list; }
internal static Table UnloadConfirmationPromptGridView(DataGridView gridView) { BindingList <ConfirmationPromptRow> list = gridView.DataSource as BindingList <ConfirmationPromptRow>; return(ConfirmationPromptRow.GetTableFromRows(list)); }