Problem with style for GridView disabled state.

5 posts, 1 answers
  1. Paul
    Paul avatar
    10 posts
    Member since:
    Jan 2011

    Posted 11 Jan 2012 Link to this post

    Hello,

    I created a GridView that I fully styled and templated. Everything is working fine except when the entire GridView gets disabled either from it's IsEnabled property or when a Child Window is opened in my Silverlight application, which disables all of the controls in the window. The GridView rows lose their styling and turn white. I have been working on this problem for a few hours and I cannot find why this is happening. I am suspecting that a property is being overwritten for the GridView's disabled state, but I cannot see that in my project. How can I make sure that my grid view maintains it's row background color when it is disabled?

    I am attaching two sample images to demonstrate what I am talking about.

    Any help would be appreciated.
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 12 Jan 2012 Link to this post

    Hello Brian,


     
    We have received different requests for the behavior of RadGridView, when its IsEnabled property is set to False. By that reason we added a Rectangle element named Background_Disabled which appears when the condition is met. If you want to revert to the previous behavior you should predefine the template of RadGridView and remove this rectangle and its corresponding state. 
    May you verify how this works for you? 



    All the best,
    Vanya Pavlova
    the Telerik team

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

  3. Paul
    Paul avatar
    10 posts
    Member since:
    Jan 2011

    Posted 12 Jan 2012 Link to this post

    I deleted the Background_Disabled rectangle and the Disabled state from my GridView template and the problem is still there. It seems to only be changing the color of the GridViewRows. I was thinking it may be part of the PART_DataCellsPresenter which is part of the GridViewRow template. If you look back at my screen shot everything else maintains it's visual state except for the cells of the GridViewRows. When I inspect the DataCellsPresenter template I see no brushes applied to any of the elements and I also see no visual states.Is there anywhere else where this may be happening?
  4. Answer
    Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 13 Jan 2012 Link to this post

    Hi Brian,


     
    In addition to my previos reply I would like to mention that you disable cells to a GridViewCell level as well. There you may see a Border element named Background_Disabled which is reponsible for the appearance of the cell in this state. Have you defined styles targeted at GridViewCell? If that is the case it would be great if you may send to us a small repro project in a new support ticket which we may use for local testing. In this way we would be able to provide you with an appropriate solution.




    Regards,
    Vanya Pavlova
    the Telerik team

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

  5. Paul
    Paul avatar
    10 posts
    Member since:
    Jan 2011

    Posted 13 Jan 2012 Link to this post

    Thank you Vanya,

    I missed the GridViewCell template. Once I made a template for it and changed the Background_Disabled border everything worked as I expected. Thank you so much for your support.

    -Brian
Back to Top