CreateDataTable() protected méthode

protected CreateDataTable ( ) : System.Data.DataTable
Résultat System.Data.DataTable
		public RowEntryCollectionForm(Table table)
			: this()
		{
			_table = table;

			this.dataGridView1.Columns.Clear();

			//Setup Columns
			var dt = table.CreateDataTable();
			var columnCount = dt.Columns.Count;

			//Add Data
			foreach (RowEntry rowEntry in table.StaticData)
			{
				//Create a row
				var dr = dt.NewRow();
				dt.Rows.Add(dr);

				//Loop through the items and create datarows
				var count = System.Math.Min(rowEntry.CellEntries.Count, columnCount);
				for (var ii = 0; ii < count; ii++)
				{
					var cellEntry = rowEntry.CellEntries[ii];
					var staticColumn = cellEntry.ColumnRef.Object as Column;
					if ((staticColumn != null) && dt.Columns.Contains(staticColumn.Name))
					{
						dr[staticColumn.Name] = cellEntry.Value;
						//_loadedColumnList.Add(cellEntry.ColumnRef.Object as Column);
					}
				}
			}

			//Bind the grid
			this.dataGridView1.DataSource = dt;

		}