This is a migrated thread and some comments may be shown as answers.

Custom column not updating and showing bad data for rows - painting issue?

3 Answers 110 Views
Grid for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Roger
Top achievements
Rank 1
Roger asked on 17 Jun 2013, 07:40 PM
I have a RadDataGrid that I am using that has a custom column. This column shows a warning image if another column's value is 0. I am noticing that the first render of the grid is correct - the indicators only show on rows which should show this warning indicator. However, if I start scrolling the list, many more of these indicators appear, and when I scroll back to the top of the list the indicator is drawn on every single row.

This looks like a painting issue. Like I said, the grid shows the indicator correctly until you start scrolling it and come back to the top. I can also confirm that this worked properly on the GridView I was using with this same binding prior.

Here is the column in question. For what it's worth, replacing the image indicator with text instead has the same issue - the text starts showing on all rows after a bit of scrolling.

<telerikGrid:DataGridTemplateColumn Header="">
  <telerikGrid:DataGridTemplateColumn.CellContentTemplate>
    <DataTemplate>
        <Image Source="ms-appx:///Assets/WarningIcon28White.png"
               Width="28"
               Height="28"
               Margin="8,-12,8,0"
               Visibility="{Binding Quantity, Converter={StaticResource visCvt}, ConverterParameter=Reverse}"
               VerticalAlignment="Center"
               HorizontalAlignment="Left" />                   
    </DataTemplate>
  </telerikGrid:DataGridTemplateColumn.CellContentTemplate>           
</telerikGrid:DataGridTemplateColumn>

3 Answers, 1 is accepted

Sort by
0
jasonxz
Top achievements
Rank 1
answered on 18 Jun 2013, 01:39 PM
I have also noticed this is a problem with the new DataGridImageColumn.

 

0
Accepted
Ivaylo Gergov
Telerik team
answered on 18 Jun 2013, 03:04 PM
Hi Roger,

Thank you for contacting us.

The UI Virtualization of RadDataGrid overrides both the Visibility and the Opacity properties of the element that represents each cell. For your scenario I can suggest two options:

  • Use the Converter for the Image.Source property instead of the Image.Visibility property and return null when the image should not be visible.
  • Put the Image in a Border element. Thus, RadDataGrid will override the Border.Visibility and the Border.Opacity properties and it will not affect the Image.

I hope this is useful. Let me know if I can assist you further.


Regards,
Ivaylo Gergov
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.

0
Roger
Top achievements
Rank 1
answered on 18 Jun 2013, 03:21 PM
Thanks, adding a border did fix it!

Thanks again,
-roger
Tags
Grid for XAML
Asked by
Roger
Top achievements
Rank 1
Answers by
jasonxz
Top achievements
Rank 1
Ivaylo Gergov
Telerik team
Roger
Top achievements
Rank 1
Share this question
or