I need to create an adorner that covers multiple cells of a xamDataGrid record.
Where is the best place to decorate records with adorners? I would like to set up the adorners once for each record. Currently, I'm adding the adorners in the RecordsInViewChanged event handler. It sort of works - the adorners do appear - but this event fires at the wrong time for me so my code has logic to avoid adding duplicate adorners to the same record.
I think if I add the adorners at the right time in the lifecycle of the xamDataGrid, then this problem might go away: The adorners are transparent and it is clear that they are being drawn multiple times in the first 3 or last 3 records on the grid when the grid is scrolled up or down.
I attached my current solution. It is Visual Studio 2010 with NetAdvantage 10.3.
Fixed the problem where extra adorners were being rendered. They weren't duplicates; they were adorners for rows that were scrolled out of view (I think the xamDataGrid is mis-behaving). Adding a check to see if the AdornedElement is visible in Adorner.OnRender fixed the problem:
if (!this.AdornedElement.IsVisible) return;
I'm still seeking advice on the best way to create DataRecord adorners.
Hello,
I wanted to follow up, please let me now if you have any further question.
Thank you,
Sam