Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
Records - Background Color (programmatically)
posted

Hi,

I would like to apply color on my background records depending on the 'Type' cell value

 

example : The lines where the 'Type' cell value  is 'Réunion' must have a red backround

 Dim HT As New Hashtable()
 Query.GetHTColors(HT) ' Get the hashtable where each type is associated with a color

 Dim MyBrush As New SolidColorBrush()

 For Each Rec As Infragistics.Windows.DataPresenter.DataRecord In Me.XamDataGrid_CRA.Records
     If Not IsDBNull(HT(Rec.Cells("Type").Value)) Then
         MyBrush = New SolidColorBrush(CType(ColorConverter.ConvertFromString(HT(Rec.Cells("Type").Value)), Color))
     Else
         MyBrush = Brushes.White
     End If

     ''

     '' How to apply MyBrush on the background ??? (here)

     ''

 Next

 

I have tried everything ... HELP

Thanks

 

Becquet.Steve