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 tell user why the cell validating do not pass.
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 tell user why the cell validating do not pass.
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