hola que tal brother, aca tengo un código para winform:
usando los tables estyle:
Código:
Dim myEstiloCol7 As New DGTxtColColor
myEstiloCol7.MappingName = "accondesc"
myEstiloCol7.HeaderText = "Estado"
myEstiloCol7.Width = 65
Código:
Public Class DGTxtColColor
Inherits DataGridTextBoxColumn
Private mColorFondoCondicion As Color
Protected Overloads Overrides Sub Paint(ByVal g As System.Drawing.Graphics, _
ByVal bounds As System.Drawing.Rectangle, _
ByVal source As System.Windows.Forms.CurrencyManager, _
ByVal rowNum As Integer, _
ByVal backBrush As System.Drawing.Brush, _
ByVal foreBrush As System.Drawing.Brush, _
ByVal alignToRight As Boolean)
Dim oBrush As SolidBrush
Dim sValorCampo As String
Dim ofiladatos As DataRowView = source.List(rowNum)
sValorCampo = CType(ofiladatos("accondesc"), String).Trim()
Select Case sValorCampo
Case "PASIVOS"
oBrush = New SolidBrush(Color.Yellow)
Case "EGRESADO"
oBrush = New SolidBrush(Color.Gold)
Case Else
oBrush = backBrush
End Select
'If CType(ofiladatos("accondesc"), String).Trim() = "EGRESADO" Then
'oBrush = New SolidBrush(Color.Gold)
'Else
'oBrush = backBrush
'End If
MyBase.Paint(g, bounds, source, rowNum, _
oBrush, _
foreBrush, _
alignToRight)
End Sub
End Class
suerte