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

How to get at the Style for a GridViewCell that has been set by a StyleSelector

1 Answer 60 Views
GridView
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 19 May 2011, 09:51 PM

I have a GridViewCell whose style has been set by a StyleSelector.

The style is a ControlTemplate that contains a Border which wraps a VisualStateManager (actually an attached property on the Border), a ContentPresenter, and a ToolTipService.ToopTip (which is also an attached property on the border).  The Border has a name, PART_CellBorder.

The ToolTip within the ToolTipService contains a collection of InteractionBehaviors which contains a single behavior, LoadToolTipTextBehavior, I'm after.

In the RadGrid's RowUnloaded event handler I need to invoke the Detach() method of the LoadToopTipTextBehavior.  I've done this in other cases with xaml defined behaviors, but not when the style has been set by a StyleSelector.  How can I get a reference to the Border? 

In the past I've drilled down into a ControlTemplate to get a reference to one of its named elements, but in this case the StyleSelector has set the Style and I have not been able to find how to get access to the style, and thus the ControlTemplate.

Thanks in advance,

George

1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 20 May 2011, 08:05 AM
Hi George,

I have just posted an answer to this inquiry in the other thread you have opened. In order to achieve a consistent and fruitful dialogue I would kindly ask you to carry out any further communication there. Thank you.

Regards,
Ivan Ivanov
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
George
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or