Different theme for grid detail view?

10 posts, 2 answers
  1. Karen Mattox
    Karen Mattox avatar
    7 posts
    Member since:
    Oct 2008

    Posted 29 Apr 2009 Link to this post

    Is it possible to set up a different theme for only the detail portion of the hierarchical grid? There does not appear to be any way in the existing gridview theme to specify cell colors and borders, row properties, etc. for the contents of the detail portion of the grid. When I change them in the existing grid theme, they do not apply to the child portion, even when I change them in the Visual Style Builder's RadGridView GridDetailViewRowElement or it's subelements. (Other changes I made in the theme do apply, so I am certain the theme is found properly). Ideally I would like the child rows to be styled differently from the parent rows, and so far the only way I seem to be able to affect them is through the CellFormatting event, but that is painful. Thank you for your time.
  2. Answer
    Jack
    Admin
    Jack avatar
    2333 posts

    Posted 30 Apr 2009 Link to this post

    Hi Karen,

    Thank you for this suggestion.

    Yes, currently it is possible to change cell appearance for child views only via code by handling the CellFormatting event. However, extending our Visual Style Builder to support this feature is a good idea and I added the request in our TODO list. We will consider implementing it in one of our future versions.

    If you have any other questions, don't hesitate to contact us.

    Regards,
    Jack
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Karen Mattox
    Karen Mattox avatar
    7 posts
    Member since:
    Oct 2008

    Posted 30 Apr 2009 Link to this post

    OK. Is there currently any way though to align the child grid rows to the right? In other words, if there is available (blank) real estate in the grid for the child row, I want it to appear on the left and the columns to be on the right side of the grid. I am NOT referring to text alignment. Thank you,
    Karen
  5. Answer
    Jack
    Admin
    Jack avatar
    2333 posts

    Posted 30 Apr 2009 Link to this post

    Hi Karen,

    It isn't possible to change the layout to be right to left only for the child views. However, similar effect can be achieved by setting the Padding property of the GridDetailViewCellElement. Please consider the code below:

    void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e) 
        if (e.CellElement is GridDetailViewCellElement) 
        { 
            e.CellElement.Padding = new Padding(100, 10, 10, 10); 
        } 

    I hope this helps. Should you have additional questions, I will be glad to answer them.

    Regards,
    Jack
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Karen Mattox
    Karen Mattox avatar
    7 posts
    Member since:
    Oct 2008

    Posted 30 Apr 2009 Link to this post

    Thank you, that works for now. Once the VisualStyleBuilder has themes for the child, there is an Align on one of the elements that might work.
  7. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 30 Apr 2009 Link to this post

    I am glad to hear that this solution is satisfactory for you. If you need further assistance, don't hesitate to contact us.

    All the best,
    Jack
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. MikeK
    MikeK avatar
    46 posts
    Member since:
    Oct 2007

    Posted 12 Apr 2011 Link to this post

    This thread is a couple of years old now. Has this option been added to VSB in a current release?

    I'm using Q3 2010 and submitted a support ticket, but the answer didn't meet my needs. I used your custom theme from the Help Desk Demo, but my child grid isn't using the black style - it's the office blue style. This looks stupid, so I tried to style it. I set absolutely every setting I found under VSB and couldn't change it.

    I attached a screen dump of my app showing my issue.
  9. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 15 Apr 2011 Link to this post

    Hello MikeK,

    Thank you for contacting us. You should change the theme registration in order to solve this issue. However, we should check the theme to be sure. Please, open a support ticket and send me your theme. I will do all modifications for you.

    I recommend that you try our latest release Q1 2011. It contains many improvements and addresses a lot of issues.

    I am looking forward to your reply.
     
    Kind regards,
    Jack
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  10. MikeK
    MikeK avatar
    46 posts
    Member since:
    Oct 2007

    Posted 15 Apr 2011 Link to this post

    I got this resolved through a support ticket this week. For other people following this thread, here are the details for resolution.

    The Q3 2010 Winforms suite doesn't expose a property needed to allow the grid to cascade the custom style to the child grid. You also can't make any changes via the style builder to make this happen. What is needed is to save your custom style as the collection of XML files, then locate the Telerik_WinControls_UI_RadGridView.xml file. Editing it manually, the following line has to be added. The style can be recompiled and saved as a tssp file again.

    <RadStylesheetRelationControlType="Telerik.WinControls.UI.RadGridView"ElementType="Telerik.WinControls.UI.GridTableElement"/>
     

  11. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 15 Apr 2011 Link to this post

    Hi MikeK, thank you for sharing your solution with the community. Do not hesitate to contact us If you have any other questions.
     
    Greetings,
    Jack
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready