BCGSoft.Controls.Grid Namespace > GridControl Class : CreateData Method |
'Declaration Public Sub CreateData()
'Usage Dim instance As GridControl instance.CreateData()
public void CreateData()
public: void CreateData();
public: void CreateData();
Grid control displays data stored in GridData object. The data can be created externally and assigned to one or more grids. This way is the best choice for data bound grids or grids working with application-defined data. In this case you just instantiate a GridData object, add rows to GridData.RowCollection and set this object to GridControl.GridControlData property. Also you have to create a "scheme" by instantiating columns, filling ColumnCollection and setting appropriate DataIndex for each column.
However, when you need an editable Execel-like grid with generic columns and rows, you have to quickly create an empty table with similar (empty) data items. In this case you should set the desired number of columns and rows using InitialNumberOfColumns and InitialNumberOfRows properties and call CreateData, which will do the work.
The created data still can be accessed and modified via the GridControlData property.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2