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
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.
Vanya Pavlova
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
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
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!
Vanya Pavlova
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
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
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.
Vanya Pavlova
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
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
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