GrapeCity.Win.MultiRow Namespace > GcMultiRow Class : RowValidating Event |
<SRDescriptionAttribute("Occurs when a row is validating.")> <SRCategoryAttribute("Focus")> <FeatureAttribute(Name="UISelection", Version="v5.0")> Public Event RowValidating As EventHandler(Of CellCancelEventArgs)
Dim instance As GcMultiRow Dim handler As EventHandler(Of CellCancelEventArgs) AddHandler instance.RowValidating, handler
[SRDescription("Occurs when a row is validating.")] [SRCategory("Focus")] [Feature(Name="UISelection", Version="v5.0")] public event EventHandler<CellCancelEventArgs> RowValidating
The event handler receives an argument of type CellCancelEventArgs containing data related to this event. The following CellCancelEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Cancel | (Inherited from System.ComponentModel.CancelEventArgs) |
CellIndex | Gets the cell index in its parent Section. |
CellName | Gets the cell name. |
RowIndex | Gets the index of the owner Row that the event occurs for. |
Scope | Gets the cell area that the event occurs for. |
SectionIndex | Gets the index of the owner Section that the event occurs for. |
void gcMultiRow1_RowValidating(object sender, CellCancelEventArgs e) { if (e.CellName == "Name" && this.gcMultiRow1[e.RowIndex, "Name"].Value == null) { e.Cancel = true; // Set error text to why the cell validation failed. this.gcMultiRow1.Rows[e.RowIndex].ErrorText = "The student name can't be empty, please input the name."; } else { this.gcMultiRow1.Rows[e.RowIndex].ErrorText = string.Empty; } }
Private Sub gcMultiRow1_RowValidating(ByVal sender As Object, ByVal e As CellCancelEventArgs) Handles gcMultiRow1.RowValidating If e.CellName = "Name" AndAlso Me.gcMultiRow1(e.RowIndex, "Name").Value = Nothing Then e.Cancel = True ' Set error text to why the cell validation failed. Me.gcMultiRow1.Rows(e.RowIndex).ErrorText = "The student name can't be empty, please input the name." Else Me.gcMultiRow1.Rows(e.RowIndex).ErrorText = String.Empty 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