GrapeCity.Win.MultiRow Namespace > GcMultiRow Class > SetValue Method : SetValue(Int32,Int32,Object) Method |
Public Overloads Sub SetValue( _ ByVal rowIndex As Integer, _ ByVal cellIndex As Integer, _ ByVal value As Object _ )
Dim instance As GcMultiRow Dim rowIndex As Integer Dim cellIndex As Integer Dim value As Object instance.SetValue(rowIndex, cellIndex, value)
Exception | Description |
---|---|
System.ArgumentOutOfRangeException | The rowIndex parameter is less than 0 or greater than the number of Rows minus 1. -or- The cellIndex parameter is less than 0 or greater than the number of Cells in the Row minus 1. |
This method sets the Value to the specified cell without instantiating the cell.
Information about instantiating the cell and row:
By default, all the Cells and Rows in a GcMultiRowcontrol do not possess memory, and their process logic and drawing are done by a template row and cell. So, most of the virtual methods exposed in Row and Cell objects need a SectionIndex parameter, so they can handle the corresponding operation logic correctly.
After certain operations, in order to save the specific cell's data, the relevant Row and Cell objects need to be instantiated. Cell data can be the CellStyle.BackColor, which is different from the template and the LinkLabelCell's LinkLabelCell.LinkVisited property. Instantiating a row or cell requires more memory. The system performance may be effected, so you should avoid using the instantiated methods and properties if possible.
The following methods, properties, or actions will BRING about the instantiation of the Row object |
---|
accessing the current row with the CurrentRow property |
accessing the specific row with the RowCollection.Item property |
copying the row collection with the RowCollection.CopyTo method |
accessing a RowCollection member with the enumerator(foreach) |
when a user adds a new row with the detached row |
when a user presses Ctrl+Del to delete one or more rows |
hiding one or more rows with the filter function |
the parent row is instantiated when a cell is instantiated |
The following methods, properties, or actions will BRING about the instantiation of the Cell object |
---|
accessing the current cell with the CurrentCell property |
accessing the specific cell with the Item(Int32,Int32) or Item(Int32,String) property |
clicking a LinkLabelCell whose LinkLabelCell.TrackVisitedState property is true |
The following methods will NOT BRING about the instantiation of the Cell or Row |
---|
getting or setting the Value by invoking the GetValue(Int32,Int32) or SetValue(Int32,Int32,Object) method |
getting the FormattedValue by invoking the GetFormattedValue(Int32,Int32) method |
getting the Cell.EditedFormattedValue by invoking the GetEditedFormattedValue(Int32,Int32) method |
accessing the CurrentCellPosition property, but not the CurrentCell or CurrentRow property |
modifying the data with the DataSource property |
Note: The above list may not contain all the methods involved with the instantiation action of the Row and Cell objects. For more details, refer to the method and property descriptions.
GrapeCity.Win.MultiRow.TextBoxCell text1 = new GrapeCity.Win.MultiRow.TextBoxCell(); GrapeCity.Win.MultiRow.TextBoxCell text2 = new GrapeCity.Win.MultiRow.TextBoxCell(); text1.Name = "text1"; text2.Name = "text2"; text2.Style.Format = "c"; GrapeCity.Win.MultiRow.Template template1 = GrapeCity.Win.MultiRow.Template.CreateGridTemplate(new GrapeCity.Win.MultiRow.Cell[] { text1, text2 }, 160, GrapeCity.Win.MultiRow.AutoGenerateGridTemplateStyles.ColumnHeader | GrapeCity.Win.MultiRow.AutoGenerateGridTemplateStyles.RowHeaderAutoNumber); template1.ColumnHeaders[0].Cells[0].Value = "Column1"; template1.ColumnHeaders[0].Cells[1].Value = "Column2"; gcMultiRow1.Template = template1; gcMultiRow1.RowCount = 3; gcMultiRow1[1, 1].Value = 5; gcMultiRow1.SetValue(0, 0, "Value1"); gcMultiRow1.SetValue(1, "text1", 3);
Dim text1 As New GrapeCity.Win.MultiRow.TextBoxCell() Dim text2 As New GrapeCity.Win.MultiRow.TextBoxCell() text1.Name = "text1" text2.Name = "text2" text2.Style.Format = "c" Dim template1 As GrapeCity.Win.MultiRow.Template = GrapeCity.Win.MultiRow.Template.CreateGridTemplate(New GrapeCity.Win.MultiRow.Cell() {text1, text2}, 160, GrapeCity.Win.MultiRow.AutoGenerateGridTemplateStyles.ColumnHeader Or GrapeCity.Win.MultiRow.AutoGenerateGridTemplateStyles.RowHeaderAutoNumber) template1.ColumnHeaders(0).Cells(0).Value = "Column1" template1.ColumnHeaders(0).Cells(1).Value = "Column2" GcMultiRow1.Template = template1 GcMultiRow1.RowCount = 3 GcMultiRow1(1, 1).Value = 5 GcMultiRow1.SetValue(0, 0, "Value1") GcMultiRow1.SetValue(1, "text1", 3)
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