or
Private Sub grid2_RowValidating(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.RowValidatingEventArgs) Handles grid2.RowValidating If TypeOf e.Row Is GridViewNewRowInfo Or TypeOf e.Row Is GridViewDataRowInfo Then If Not e.Row Is Nothing Then Dim value As String = e.Row.Cells(1).Value If value > 10 Then e.Cancel = True e.Row.Cells(1).ErrorText = "cannot be greater than 10" e.Row.ErrorText = "cannot be greater than 10" e.Row.Cells(1).Style.ForeColor = Color.Red 'These did not work so had to use the cell formating 'e.Row.Cells(1).Style.DrawFill = True 'e.Row.Cells(1).Style.NumberOfColors = 1 'e.Row.Cells(1).Style.BackColor = Color.Peru 'e.Row.Cells(1).Style.DrawBorder = True 'e.Row.Cells(1).Style.BorderWidth = 2 Else e.Row.ErrorText = String.Empty End If End If End IfEnd SubPrivate Sub grid2_ViewCellFormatting(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.CellFormattingEventArgs) Handles grid2.ViewCellFormatting If grid2.IsInEditMode Then If TypeOf e.Row Is GridViewRowInfo Then Select Case e.ColumnIndex Case 1 e.CellElement.DrawFill = True e.CellElement.NumberOfColors = 1 'validate again?? to set the coloring? If e.CellElement.Value > 10 Then 'set visual clue e.CellElement.BackColor = Color.Peru e.CellElement.ForeColor = Color.Yellow e.CellElement.Image = My.Resources._error Else 'reset all e.CellElement.BackColor = Color.White e.CellElement.ForeColor = Color.Black e.CellElement.Image = Nothing End If End Select End If End IfEnd Sub

lstAreasDisponibles (listControl) properties :private void cargarDatosListAreaDisponible() { string query = "SELECT Vista_Cat_Adscripcion_SIRH.Indice, Vista_Cat_Adscripcion_SIRH.Nombre " + "FROM Vista_Cat_Adscripcion_SIRH INNER JOIN " + " Vehiculos ON Vista_Cat_Adscripcion_SIRH.Indice = Vehiculos.IdArea " + "GROUP BY Vista_Cat_Adscripcion_SIRH.Indice, Vista_Cat_Adscripcion_SIRH.Nombre, " + " Vehiculos.Status " + "HAVING Vehiculos.Status = '1' "+ "ORDER BY Vista_Cat_Adscripcion_SIRH.Nombre"; Query obj = new Query(); DataTable dt = obj.obtenerSelect(query); string[,] datos = new string[dt.Rows.Count, dt.Columns.Count]; for (int fila = 0; fila < dt.Rows.Count; fila++) { RadListDataItem rldi = new RadListDataItem(); rldi.TextWrap = true; rldi.Text = dt.Rows[fila][1].ToString(); lstAreasDisponibles.Items.Add(rldi); } }