System.Windows.Forms.DataGridViewColumnCollection.Add(string, string)

Here are the examples of the csharp api class System.Windows.Forms.DataGridViewColumnCollection.Add(string, string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

5 Examples 7

1. Example

Project: SQLMonitor
Source File: OutlookGrid.cs
private void SetupColumns()
        {
            ArrayList list;

            // clear all columns, this is a somewhat crude implementation
            // refinement may be welcome.
            Columns.Clear();

            // start filling the grid
            if (_dataSource == null)
                return;
            else
                list = _dataSource.Rows;
            if (list.Count <= 0) return;

            foreach (string c in _dataSource.Columns)
            {
                int index;
                var column = Columns[c];
                if (column == null)
                    index = Columns.Add(c, c);
                else
                    index = column.Index;
                Columns[index].SortMode = DataGridViewColumnSortMode.Programmatic; // always programmatic!
            }

        }

2. Example

Project: ErrorControlSystem
Source File: DataGridViewHelper.cs
public static void CreateColumns(DataGridView dgv)
        {

            foreach (var property in typeof(TCol).GetProperties())
            {
                dgv.Columns[dgv.Columns.Add(property.Name, GetHeaderNameFromColName(property.Name))].DataPropertyName
                    =
                    property.Name;
            }
        }

3. Example

Project: ares
Source File: RasterGridView.cs
public void SetValues(Position tlCorner, Position brCorner, double[,] values)
        {
            /n ..... /n //View Source file for more details /n }

4. Example

Project: Ego-Engine-Modding
Source File: Form1.cs
private void setupPage() {
            // Back out if the page has already been SetUp
            if/n ..... /n //View Source file for more details /n }

5. Example

Project: OrionSDK
Source File: QueryTab.cs
private void queryWorker_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedE/n ..... /n //View Source file for more details /n }