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

How to get some properties from theme

1 Answer 123 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Veljko Janjic
Top achievements
Rank 1
Veljko Janjic asked on 14 Jan 2008, 02:15 PM
Is there a way to read some properties of selected theme (e.g background color of selected cells or any other property)?

Thanks in advance

1 Answer, 1 is accepted

Sort by
0
Mike
Telerik team
answered on 15 Jan 2008, 12:04 PM
Hello Veljko Janjic,

Thank you for contacting us.

Even though all property settings are available through the StyleSheet object, it would be really hard to process the complex structure and find the needed property values.

The main issue comes form the fact that themes define property values for various states of different elements. For example, GridViewCell elements have different appearance depending on the value of IsCurrent and IsSelected properties.

There is also property-value inheritance mechanism, similar to Control's ambient properties. This means an element may have a different background color depending on its parent's style. Another problem is that the appearance of an element is formed by a number of properties which should be respected in order to have correct results.

If you need information about the runtime appearance properties (unlike the toolbox toolstrip for example), elements of RadControls, use the actual property values for painting. That's why, the simpler solution would be to check the values of different properties of RadGridView at runtime, similar to the approach of RadControlSpy.

Another solution is to simulate grid elements and use style API to apply style over these template objects - grid cells and rows, which can be used to check the resulting property values. We have prepared an application that demonstrates this approach.

Please, if you have any questions, do not hesitate to write.

Sincerely yours,
Mike
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Veljko Janjic
Top achievements
Rank 1
Answers by
Mike
Telerik team
Share this question
or