BCGSoft.Controls.Grid Namespace > GridDataRow Class : ItemCollection Property |
'Declaration Public ReadOnly Property ItemCollection As GridDataItemCollection
'Usage Dim instance As GridDataRow Dim value As GridDataItemCollection value = instance.ItemCollection
public GridDataItemCollection ItemCollection {get;}
public: __property GridDataItemCollection* get_ItemCollection();
public: property GridDataItemCollection^ ItemCollection { GridDataItemCollection^ get(); }
This collection is the place where the actual data is stored.
For example, you have the following data structure to be shown in the Grid:
{Name, Age, Email}
You fill the grid with data as following:
// get data from the grid control. Alternatively a new instance GridData can be created
// and later set to GridControlData
GridData data = _gridControl.GridControlData;
// Create new row
GridDataRow row = new GridDataRow ();
// Create items that incapsulate the data
GridDataItem itemName = new GridDataItem ();
item.ItemData = "John";
GridDataItem itemAge = new GridDataItem ();
item.ItemData = 25;
GridDataItem itemMail = new GridDataItem ();
item.DataType = GridDataType.Hyperlink;
item.ItemData = "mailto:john@msn.com";
// Add items to item collection
row.ItemCollection.Add (itemName);
row.ItemCollection.Add (itemAge);
row.ItemCollection.Add (itemMail);
// Add row to row collection
data.RowCollection.Add (row);
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