Change the cell color
Private Sub RadGridView1_CellFormatting(sender As Object, e As CellFormattingEventArgs) Handles RadGridView1.CellFormatting
Select Case e.CellElement.ColumnInfo.HeaderText
Case "Receipt Qty"
Select Case e.CellElement.RowInfo.Cells("QtyMismatch1").Value
Case 1
e.CellElement.DrawFill = True
e.CellElement.ForeColor = Color.Red
e.CellElement.NumberOfColors = 1
Case Else
e.CellElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local)
e.CellElement.ResetValue(LightVisualElement.ForeColorProperty, ValueResetFlags.Local)
e.CellElement.ResetValue(LightVisualElement.NumberOfColorsProperty, ValueResetFlags.Local)
End Select
End Select
End Sub
Similar to the above
e.CellElement.DrawFill = True
e.CellElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid
e.CellElement.ForeColor = Color.Maroon
Make a cell Read Only
If e.CellElement.ColumnIndex = 0 Then
If Not Me.DragAndDropGrid1.CurrentCell Is Nothing Then
If Me.DragAndDropGrid1.CurrentRow.Cells("TruckPO").Value > "" Then
e.CellElement.ColumnInfo.[ReadOnly] = True
Else
e.CellElement.ColumnInfo.[ReadOnly] = False
End If
End If
End If
Disable/Enable a cell
If e.CellElement.ColumnInfo.Name = "cmdFileName" Then
If e.CellElement.Value = "" Then
e.CellElement.Enabled = False
Else
e.CellElement.Enabled = True
End If
End If
Another way to hide a cell
Select Case e.CellElement.ColumnInfo.HeaderText.ToUpper
Case "DELETE"
If Not e.CellElement.RowInfo.Cells("unitprce").Value Is System.DBNull.Value Then
e.CellElement.Visibility = ElementVisibility.Collapsed
End If
End Select