This question is locked. New answers and comments are not allowed.
Hello,
I am currently facing a problem with CellStyleSelector,
I have RadGridView bound with a Collection of GridViewColumns, I am applying CellStyleSelector to each of these columns. I have virtualization on due to large dataset.
When the grid is displayed, the first intial view has all the style applied correctly, but then when I scroll, my StyleSelector is called, it returns the style too depending on my conditions, but when the grid is displayed the style is not applied.
And the StyleSelector is not called for all the cells displayed after scrolling to previously viewed part of the grid. Its called for a few cells and the style is not applied for these few cells (even though StyleSelector is called only for them.)
Here is my code for CellStyleSelector
Here is how i declared my style in xaml, and assign it to the column,
I am also using customised Scroller (GridViewScrollViewer).
I am using GridView version 2010.2.714.1030
I am also attaching an image,
here the complete row was to be colored brown,
I am currently facing a problem with CellStyleSelector,
I have RadGridView bound with a Collection of GridViewColumns, I am applying CellStyleSelector to each of these columns. I have virtualization on due to large dataset.
When the grid is displayed, the first intial view has all the style applied correctly, but then when I scroll, my StyleSelector is called, it returns the style too depending on my conditions, but when the grid is displayed the style is not applied.
And the StyleSelector is not called for all the cells displayed after scrolling to previously viewed part of the grid. Its called for a few cells and the style is not applied for these few cells (even though StyleSelector is called only for them.)
Here is my code for CellStyleSelector
public class MyStyleSelector : StyleSelector { private static readonly Brush DefaultBackgroundBrush = new SolidColorBrush(Colors.Brown); public override System.Windows.Style SelectStyle(object item, System.Windows.DependencyObject container) { var style = new Style(typeof(GridViewCell)); var background = DefaultBackgroundBrush; style.Setters.Add(new Setter(GridViewCell.BackgroundProperty, background)); return style; }}Here is how i declared my style in xaml, and assign it to the column,
<!--xaml file--><Controls:MyStyleSelector x:Key="styleSelector"/>//c sharp codegridViewDataColumn.CellStyleSelector = App.Current.Resources["styleSelector"] as StyleSelector;I am also using customised Scroller (GridViewScrollViewer).
I am using GridView version 2010.2.714.1030
I am also attaching an image,
here the complete row was to be colored brown,