Intersoft WebGrid Documentation
SetItemData Method
See Also  Send Feedback
ISNet.WebUI.WebGrid Namespace > WebGridCellCollection Class : SetItemData Method






Sets an array of strings as the cell data text for this row instance. Sets an array of strings as the cell data text for this row instance.

Overload List

OverloadDescription
SetItemData(String[])Sets an array of strings as the cell data text for this row instance.  
SetItemData(Object[])Sets an array of objects as the cell data value for this row instance.  
SetItemData(String[],Object[])Sets an array of strings and objects as the cell data value for this row instance  

Example

The following sample codes show you that SetItemData method allows you to easily set an array of string which will be mapped to the cells in WebGridCellCollection respectively.

[C#]

WebGridRow[] rootRows = new WebGridRow[6];

for (int i = 0; i < 6; i++) rootRows[i] = WebGrid1.RootTable.CreateRow();

rootRows[0].Cells.SetItemData(new string[] { "172-32-1176", "White", "Johnson" });                      rootRows[1].Cells.SetItemData(new string[] { "213-46-8915", "Green", "Marjorie" });                     rootRows[2].Cells.SetItemData(new string[] { "238-95-7766", "Carson", "Cheryl" });                      rootRows[3].Cells.SetItemData(new string[] { "267-41-2394", "O'Leary", "Michael" });                    rootRows[4].Cells.SetItemData(new string[] { "274-80-9391", "Straight", "Dean" });                       rootRows[5].Cells.SetItemData(new string[] { "341-22-1782", "Smith", "Meander" });

WebGrid1.RootTable.Rows.AddRange(rootRows);

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.