GrapeCity MultiRow Windows Forms Documentation
Value Property (Cell)
Example 


Gets or sets the value associated with this cell.
Syntax
<TypeConverterAttribute("GrapeCity.Win.MultiRow.Design.CellValueTypeConverter, GrapeCity.Win.MultiRow, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")>
<RefreshPropertiesAttribute(RefreshProperties.All)>
<EditorAttribute(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName="GrapeCity.Win.MultiRow.Design.CellValueTypeEditor, GrapeCity.Win.MultiRow, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")>
<SRCategoryAttribute("Data")>
<SRDescriptionAttribute("Indicates the value of the Cell.")>
Public Property Value As Object
Dim instance As Cell
Dim value As Object
 
instance.Value = value
 
value = instance.Value
[TypeConverter("GrapeCity.Win.MultiRow.Design.CellValueTypeConverter, GrapeCity.Win.MultiRow, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")]
[RefreshProperties(RefreshProperties.All)]
[Editor(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName="GrapeCity.Win.MultiRow.Design.CellValueTypeEditor, GrapeCity.Win.MultiRow, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")]
[SRCategory("Data")]
[SRDescription("Indicates the value of the Cell.")]
public object Value {get; set;}

Property Value

A System.Object value that represents the data stored by the cell. The default is a null reference (Nothing in Visual Basic).
Remarks

When you assign a different value to a cell, the GcMultiRow.CellValueChanged event of the GcMultiRow control occurs.

The Value property is the actual data object contained by the cell, whereas the FormattedValue property is the formatted representation of the data. The ValueType and FormattedValueType properties correspond to the data types of these values, respectively.

When you set the Value property, the specified value is not automatically converted from a formatted, display value to an underlying cell value. For example, the CellStyle in effect for the cell is ignored, so setting Value to CellStyle.NullValue does not result in a property value of CellStyle.DataSourceNullValue.

Example
This example sets the Value property.
GrapeCity.Win.MultiRow.TextBoxCell text1 = new GrapeCity.Win.MultiRow.TextBoxCell();
GrapeCity.Win.MultiRow.CheckBoxCell check2 = new GrapeCity.Win.MultiRow.CheckBoxCell();
GrapeCity.Win.MultiRow.Template template1 = GrapeCity.Win.MultiRow.Template.CreateGridTemplate(new GrapeCity.Win.MultiRow.Cell[] {text1, check2}, 160, GrapeCity.Win.MultiRow.AutoGenerateGridTemplateStyles.ColumnHeader | GrapeCity.Win.MultiRow.AutoGenerateGridTemplateStyles.RowHeaderAutoNumber);
template1.ColumnHeaders[0].Cells[0].Value = "Column1";
gcMultiRow1.Template = template1;
gcMultiRow1.RowCount = 3;
gcMultiRow1[1, 0].ShowWaveLine = true;
gcMultiRow1[1, 0].WaveLineColor = System.Drawing.Color.Coral;
gcMultiRow1[1, 0].Tag = "Tag1";
gcMultiRow1[1, 0].Value = 5;
Dim text1 As New GrapeCity.Win.MultiRow.TextBoxCell()
Dim check2 As New GrapeCity.Win.MultiRow.CheckBoxCell()
Dim template1 As GrapeCity.Win.MultiRow.Template = GrapeCity.Win.MultiRow.Template.CreateGridTemplate(new GrapeCity.Win.MultiRow.Cell() {text1, check2}, 160, GrapeCity.Win.MultiRow.AutoGenerateGridTemplateStyles.ColumnHeader Or GrapeCity.Win.MultiRow.AutoGenerateGridTemplateStyles.RowHeaderAutoNumber)
template1.ColumnHeaders(0).Cells(0).Value = "Column1"
GcMultiRow1.Template = template1
GcMultiRow1.RowCount = 3
GcMultiRow1(1, 0).ShowWaveLine = True
GcMultiRow1(1, 0).WaveLineColor = System.Drawing.Color.Coral
GcMultiRow1(1, 0).Tag = "Tag1"
GcMultiRow1(1, 0).Value = 5
Requirements

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

See Also

Reference

Cell Class
Cell Members
CellValueChanged Event
ValueType Property
FormattedValueType Property
FormattedValue Property

 

 


Copyright © GrapeCity, inc. All rights reserved.