Nesting GridViews and Setting Styles

4 posts, 0 answers
  1. Barry
    Barry avatar
    90 posts
    Member since:
    Jul 2011

    Posted 20 Aug 2012 Link to this post

    I have a gridview nested like this:
    <radtabcontrol>
        <radgridview style="styleA">
            <rowdetails> (from inside style A)
               
    <radtabcontrol>
                    <radgridview style="styleB"/>
                </radtabcontrol>
            </rowdetails>
        </radgridview>
    </radtabcontrol>

    Style A works fine and the columns are displayed from the style, but Style B does not. The data gets into the inner gridview, but no columns show up unless I set AutoGenerateColumns to true. I'm setting the first gridview to style A that includes a gridview inside of the style that I need to set to style B. Is there some weird thing that won't let you set the style of a gridview that is inside another style? The main gridview is in a page/view and both of the styles are in a resource dictionary.
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 22 Aug 2012 Link to this post

    Hello,

     I have tested applying a simple style to a details GridView defined as you have suggested. The style was applied successfully. May I ask you how have you defined the style that does not apply?

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Barry
    Barry avatar
    90 posts
    Member since:
    Jul 2011

    Posted 23 Aug 2012 Link to this post

    I don't see how you could have possibly gotten this to work. I have found my solution though. I use control templates for the inside grid views and that seems to work fine. It almost seems that the grid views inside the row details are inheriting the style from the grid view that they are in... oh well, it works for me now.

    <radtabcontrol>
        <radgridview style="styleA">
            <rowdetails> (from inside style A)
                <radtabcontrol>
                    <radgridview Template="templateA"/>
                </radtabcontrol>
            </rowdetails>
        </radgridview>
    </radtabcontrol>
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 23 Aug 2012 Link to this post

    Hi,

     I have attached the test project I used to check how the styles are applied.

    Greetings,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top