GrapeCity.Win.MultiRow Namespace > GcMultiRow Class : CellValuePushed Event |
<SRCategoryAttribute("Data")> <SRDescriptionAttribute("Occurs when the VirtualMode property of the GcMultiRow control is true and a cell value has changed and requires storage in the underlying data source.")> <FeatureAttribute(Name="VirtualMode", Version="v5.0")> Public Event CellValuePushed As EventHandler(Of CellValueEventArgs)
Dim instance As GcMultiRow Dim handler As EventHandler(Of CellValueEventArgs) AddHandler instance.CellValuePushed, handler
[SRCategory("Data")] [SRDescription("Occurs when the VirtualMode property of the GcMultiRow control is true and a cell value has changed and requires storage in the underlying data source.")] [Feature(Name="VirtualMode", Version="v5.0")] public event EventHandler<CellValueEventArgs> CellValuePushed
The event handler receives an argument of type CellValueEventArgs containing data related to this event. The following CellValueEventArgs properties provide information specific to this event.
Property | Description |
---|---|
CellIndex | Gets the cell index in its parent Section. (Inherited from GrapeCity.Win.MultiRow.CellEventArgs) |
CellName | Gets the cell name. (Inherited from GrapeCity.Win.MultiRow.CellEventArgs) |
RowIndex | Gets the index of the owner Row that the event occurs for. (Inherited from GrapeCity.Win.MultiRow.CellEventArgs) |
Scope | Gets the area of the cell that the event occurs for. (Inherited from GrapeCity.Win.MultiRow.CellEventArgs) |
SectionIndex | Gets the index of the owner Section that the event occurs for. (Inherited from GrapeCity.Win.MultiRow.CellEventArgs) |
Value | Gets or sets the value that is used as the cell's value. |
void gcMultiRow1_CellValuePushed(object sender, CellValueEventArgs e) { // When the user edits the value, MultiRow updates the data. Student student = userData[e.RowIndex]; if (e.CellName == "Name") { student.Name = e.Value.ToString(); } else { int value; if (!int.TryParse(e.Value.ToString(), out value)) { MessageBox.Show("Score should be a number"); return; } if (e.CellName == "Mathematics") { student.MathematicsScore = value; } else if (e.CellName == "Philosophy") { student.PhilosophyScore = value; } } }
Private Sub gcMultiRow1_CellValuePushed(ByVal sender As Object, ByVal e As CellValueEventArgs) Handles gcMultiRow1.CellValuePushed ' When the user edits the value, MultiRow updates the data. Dim student As Student = userData(e.RowIndex) If e.CellName = "Name" Then student.Name = e.Value.ToString() Else Dim value As Integer If Not Integer.TryParse(e.Value.ToString(), value) Then MessageBox.Show("Score should be a number") Return End If If e.CellName = "Mathematics" Then student.MathematicsScore = value ElseIf e.CellName = "Philosophy" Then student.PhilosophyScore = value End If End If End Sub
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