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

[Solved] Setting CellStyle on a GridView hosted in a custom control

2 Answers 96 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.
Klaus
Top achievements
Rank 1
Klaus asked on 18 Mar 2009, 02:36 PM
Hi,

For our internal control library we are implementing a DataGrid control with the GridView. We expose our own interfaces in this library and do not expose 3rd party controls directly (obviously to keep our interfaces constant i.e. backward compatible).
We encapsulate all 3rd party controls in an own custom control and only expose proprietary types.

The grid performs well except for one major issue: we are unable to set a CellStyle through our own dependency property. What we have tried is to define a style as a resource with a proprietary type as its targettype. We set that style to our own dependency property. In the changed event handler of that dependency property we delegate that style to the internal Telerik column while changing the targettype. Unfortunately it fails with an unhandled exception.

I've created a sample project which can be downloaded here

Can you please guide us how to implement this behaviour?
This would be a blocking issue to continue using the Telerik library if this isn't possible... The same issue is applicable to HeaderCellStyle and RowStyle.

Thanks for looking into this.

Klaus Vancamelbeke

2 Answers, 1 is accepted

Sort by
0
Klaus
Top achievements
Rank 1
answered on 20 Mar 2009, 07:34 AM
Hi again,

Any news on this issue? Can a Telerik team member confirm they are looking into it? The decision if we can continue with the GridView is pending and this is a blocking issue...

Thanks,

Klaus Vancamelbeke
0
Nedyalko Nikolov
Telerik team
answered on 25 Mar 2009, 10:24 AM
Hello Klaus,

I've just copy/paste my answer from your support ticket as a reference for other members of the Telerik community.

Sorry for the delay of our answer.

These are some restrictions related to styles in Silverlight. One is that there no BasedOn attribute which does not allow you to set just DataTemplate for a ContentControl, you have to set the whole ControlTemplate.

I'm attaching a modified version of your sample project. My changes are marked with "changed by Telerik" comment.

Hope this will help.

Sincerely yours,
Nedyalko Nikolov
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
Klaus
Top achievements
Rank 1
Answers by
Klaus
Top achievements
Rank 1
Nedyalko Nikolov
Telerik team
Share this question
or