void choosecolumnspage_GetAvailableColumns(object sender, AvailableColumnsArgs args) { Debug.Assert(this.VirtualInput != null, "Virtual Input is not valid."); this.ClearErrors(); try { IDTSVirtualInputColumnCollection100 virtualInputColumnCollection = this.VirtualInput.VirtualInputColumnCollection; foreach (IDTSVirtualInputColumn100 virtualInputColumn in virtualInputColumnCollection) { AvailableColumnElement element = new AvailableColumnElement(); element.Selected = virtualInputColumn.UsageType != DTSUsageType.UT_IGNORED; element.AvailableColumn = new DataFlowElement(virtualInputColumn.Name, virtualInputColumn); args.AvailableColumnCollection.Add(element); } } catch (Exception ex) { this.ReportErrors(ex); } }
/// <summary> /// Loading available columns to the upper grid. /// </summary> private void LoadAvailableColumns() { this.dataGridViewAvailableColumns.Rows.Clear(); if (this.GetAvailableColumns != null) { AvailableColumnsArgs args = new AvailableColumnsArgs(); this.GetAvailableColumns(this, args); if (args.AvailableColumnCollection.Count > 0) { this.dataGridViewAvailableColumns.Rows.Add(args.AvailableColumnCollection.Count); for (int i = 0; i < args.AvailableColumnCollection.Count; ++i) { AvailableColumnElement availableColumnRow = args.AvailableColumnCollection[i]; this.dataGridViewAvailableColumns.Rows[i].Cells[this.gridCheckBoxAvailableColumns.Index].Value = availableColumnRow.Selected; SetGridCellData(this.dataGridViewAvailableColumns.Rows[i].Cells[this.gridTextBoxAvailableColumns.Index], availableColumnRow.AvailableColumn); } } } }