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

Force a cell to use the StyleSelector

4 Answers 73 Views
GridView
This is a migrated thread and some comments may be shown as answers.
J-F
Top achievements
Rank 1
J-F asked on 15 Jun 2011, 11:43 PM
Hi,

I've created a new type column by inheriting from GridViewBoundColumnBase and it's using a StyleSelector.

Is there a way to force a cell to call it's style selector for refresh it's style base on some external (from the grid) action ?

I need to change the color of the cell even if it's content hasn't changed at all.

4 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 16 Jun 2011, 07:11 AM
Hello Jean-Fran├žois,

One way to do that is to call the Rebind method of the grid. Another approach would be to raise a fake property changed event on the respective data item. 

All the best,
Milan
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
0
J-F
Top achievements
Rank 1
answered on 16 Jun 2011, 08:08 PM
What I need, is for the cell to change it's background color (with a different style) based on a second binding. 

My problem is that I need to make sure it calls the style selector when that second binding changes, not the main binding.

I would like to avoid rebinding the whole grid when that happens !

Could I inherit from GridViewCell to control the refresh or make the cell depend on more than one binding ? If I can, how can I inject the new cell type ?
0
J-F
Top achievements
Rank 1
answered on 23 Jun 2011, 02:39 PM
So, is there anyway to do it ?
0
Pavel Pavlov
Telerik team
answered on 24 Jun 2011, 03:10 PM
Hello Jean-Fran├žois,

As Milan wrote earlier , you will need to raise a fake "NotifyPropertyChanged" event on your business object.
This event will trigger refresh only for the item , not for the whole grid view.
I believe this is as close as we can get.

All the best,
Pavel Pavlov
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
J-F
Top achievements
Rank 1
Answers by
Milan
Telerik team
J-F
Top achievements
Rank 1
Pavel Pavlov
Telerik team
Share this question
or