GridViewCell Invalid style

8 posts, 1 answers
  1. Antti
    Antti avatar
    23 posts
    Member since:
    May 2011

    Posted 13 Dec 2011 Link to this post

    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
  2. Answer
    Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 13 Dec 2011 Link to this post

    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 >>

  3. Antti
    Antti avatar
    23 posts
    Member since:
    May 2011

    Posted 14 Dec 2011 Link to this post

    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
  4. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 14 Dec 2011 Link to this post

    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 >>

  5. Antti
    Antti avatar
    23 posts
    Member since:
    May 2011

    Posted 14 Dec 2011 Link to this post

    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
  6. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 14 Dec 2011 Link to this post

    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 >>

  7. Antti
    Antti avatar
    23 posts
    Member since:
    May 2011

    Posted 14 Dec 2011 Link to this post

    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
  8. Antti
    Antti avatar
    23 posts
    Member since:
    May 2011

    Posted 04 Jun 2012 Link to this post

    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
Back to Top