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
80
XAM Row Color
posted

I tried this one but getting the Error::Cannot implicitly convert type 'System.Drawing.Brush' to 'System.Windows.Media' 

 RecordCollectionBase
recordCollection = grdPayments.Records;foreach (Record rec in recordCollection)

{

if (m_count == grdPayments.Records.Count)

{

DataRecordPresenter.FromRecord(rec).Background = Brushes.Orange;

}

}

Parents
No Data
Reply
  • 69686
    posted

    Hello,

    The problem is with the type of brush. The Background property is of type LinearGradientBrush. You can see all the default styles in the local directory on your computer : "~ \Infragistics\NetAdvantage for WPF 2008 Vol. 2\DefaultStyles". Here is the solution:

    RecordCollectionBase recordCollection = grdPayments.Records;

    foreach (Record rec in recordCollection)

    {

        if (rec.Index == grdPayments.Records.Count-1)

        {

               DataRecordPresenter.FromRecord(rec).Background = new LinearGradientBrush(Colors.Azure, Colors.CadetBlue, 45);

        }

    }

    Hope this helps.

Children