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

GridViewCell Invalid style

7 Answers 101 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Antti
Top achievements
Rank 1
Antti asked on 13 Dec 2011, 01:05 PM
Hi,

I'm trying to style our grids to show invalid cells. I have tried to modify GridViewCell style's Invalid state in ValueStates group. Modifications to elements shown in this state do not affect the view in any way when invalid cells are handled. For example, if I change the error Borders' color to blue, the border still stays red as in the default style. Is there some other place that needs to be modified? Or have the state names changed recently and that is what makes the template being not used?

Regards,
Antti

7 Answers, 1 is accepted

Sort by
0
Accepted
Vanya Pavlova
Telerik team
answered on 13 Dec 2011, 01:24 PM
Hi Antti,

 

Generally you are on the right way! The predefined cell style will work if you perform the validation in view mode and the changes will be visible there. If you perform the validation in edit mode you have to predefine the behavior of the GridViewEditorPresenter and the elements contained in it. 
I am attaching you sample application which demonstrates how to achieve this.


All the best,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Antti
Top achievements
Rank 1
answered on 14 Dec 2011, 06:44 AM
Thanks for the quick answer, once again!

I'm pretty sure that this is the reason for and the solution to my problem. One more question, though.

I use the Custom Theme approach to apply styles to my grid. So, how can I pass my theme to the GridViewEditorPresenter as I cannot find it from any of the comtrol templates? I would have guessed that adding my theme to DataCellsPresenter on GridViewRow would have helped, but that doesn't seem to do it.

Regards,
Antti
0
Vanya Pavlova
Telerik team
answered on 14 Dec 2011, 09:00 AM
Hi Antti,

 

Actually you do not have to pass it to a row because this logic is internally handled. The GridViewEditorPresenter is used as a presenter for the edit element of a GridViewCell. You have to add all files related to RadGridView and reference the key of your custom theme where needed. Then the changes will be handled correspondingly. 
Hope this helps!  



Kind regards,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Antti
Top achievements
Rank 1
answered on 14 Dec 2011, 09:20 AM
Hi,

This is just what I tried to do before trying to find the GridViewEditorPresenter from the templates. However, I always get the default error style even though I have referenced the GridViewEditorPresenter.xaml in my theme and use theme in RadGridView element. All other styles such as headers, footers, etc. function correctly.

Could there be something that I'm missing?

EDIT: I can get the error style applied if I add the GridViewEditorPresenter.xaml to the application's resources, so that it will be applied outside of the Theme, but this is not the correct way to do it, right?

Regards,
Antti
0
Vanya Pavlova
Telerik team
answered on 14 Dec 2011, 10:35 AM
Hello Antti,

 

For the time being I am not quite sure what might be wrong. I have tested the behavior using fully-functional custom theme for RadGridView and everything works fine by my side. 
Will you please take a look at the attached project and let me know how it differs from yours? 
Furthermore you may also send your application to us as an attachment in a new support ticket.
We may take a look at it and we would be able to provide you with an appropriate solution. 



All the best,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Antti
Top achievements
Rank 1
answered on 14 Dec 2011, 11:47 AM
Hi,

I didn't quite undestand what was supposed to be in the sample project as I didn't find any theme inside it. I have seen that themes provided by Telerik seem to be able to change the appearance of error state. So, I suspect that there is something missing from my theme, but I just don't know what.

It is too much of work to try to separate a sample from our application, but thank you for the help anyway. I will have to try to find the reason by testing different approaches. If you still have some suggestions they would be highly appreciated.

Best regards,
Antti
0
Antti
Top achievements
Rank 1
answered on 04 Jun 2012, 10:57 AM
Hi,

I still have the same old issue with GridViewEditorPresenter (style doesn't come automatically from theme), and now I have the same problem also with GridViewGroupPanel. Do you have any suggestions? All other controls get theis styles from the theme as suspected.

Regards,
Antti
Tags
GridView
Asked by
Antti
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Antti
Top achievements
Rank 1
Share this question
or