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

[Solved] Virtualization and behavior implementation issue

1 Answer 101 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Zainab Vora
Top achievements
Rank 1
Zainab Vora asked on 20 Aug 2010, 10:14 PM
Hello,

I am currently using RadGridView to display large amount of data, I am using silverlight 3 and gridview version is 2010.1.309.1030

I need to apply Foreground color to each cell depending on the value being displayed. Currently we are doing using styles as follows

  <Controls:GridViewCellContentControl GridViewCell="{Binding RelativeSource={RelativeSource TemplatedParent}}" HorizontalContentAlignment="Stretch">
                <ContentPresenter
                    x:Name="PART_ContentPresenter"
                    Margin="{TemplateBinding Padding}"
                    Content="{TemplateBinding Content}"
                    ContentTemplate="{TemplateBinding ContentTemplate}"/>
            </Controls:GridViewCellContentControl>

and the Style is applied to the grid column as follows

 column.CellStyle = Resources["DefaultGridViewCellStyle"] as Style;

But this method slows down the application, so we are looking for different alternative

There was this blog about applying highlights through behaviors
http://blogs.telerik.com/blogs/posts/09-10-03/adding_additional_power_to_radgridview_for_silverlight_with_attached_behaviors.aspx
I tried to implement this. But came across different issue.

Due to large amount of data, we have column virtualization on and it can not be disabled. So event onRowLoad contains only the cell values being displayed and not the complete row. After scrolling, the behavior is not applied to the other cells.

Is there any other event that can be used (which gets activated after the scrolling happens)??

Or any other way that the behavior can be applied on GridViewCell??

Thank you so much

1 Answer, 1 is accepted

Sort by
0
Yavor Georgiev
Telerik team
answered on 23 Aug 2010, 12:28 PM
Hello Zainab Vora,

 The very next minor release of the version you are using, 2010.1.422.1030 aka 2010 Q1 SP1 adds conditional style and template selectors for various elements of RadGridView, including GridViewCell. You can learn more about them here. StyleSelectors are the officially-supported way of applying formatting to only certain elements based on some logic.

Kind regards,
Yavor Georgiev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Zainab Vora
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Share this question
or