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
525
Highlighting record background problem
posted

I've included a quick sample to demonstrate the problem where additional records are being highlighted.

Step to reproduce:

1. click on the first row

2. click on the second row (the first row background is red as expected)

3. scroll down and you will see that the row with "text11" also now has a red background.

 

Thanks,

Jamie

GridSample.zip
  • 69686
    Verified Answer
    posted

    Hello Jamie,

    This is expected as you are setting the background property of the presenter locally. By default, the XamDataGrid virtualizes and reuses presenters so that is why you are seeing this incorrect behavior.

    Although you can resolve this by turning off the virtualization (which is not recommended if you have many records) by setting the RecordContainerGenerationMode property of the XamDataGrid to PreLoad, we would recommend using converters to achieve this. You can see some sample implementation of this here.