XML formatting within RadGrid

3 posts, 0 answers
  1. Chris
    Chris avatar
    13 posts
    Member since:
    Dec 2011

    Posted 30 Jul 2017 Link to this post

    Hello,

    I would like to be able to display formatted xml within a RadGrid using either google prettify or highlightjs.  I'm currently trying to display it within a NestedViewTemplate within a RadGrid.  Outside of the grid displays fine but it never works inside.  I'd also like to retain the skins if possible.

    Here's a simple example:

                        <NestedViewTemplate>
                              <pre class="prettyprint">&lt;samplexml&gt;&lt;tag value=&quot;1&quot;/&gt;&lt;/samplexml&gt;</pre>
                        </NestedViewTemplate>

    Thanks

  2. Eyup
    Admin
    Eyup avatar
    3986 posts

    Posted 03 Aug 2017 Link to this post

    Hello Chris,

    For customization of layout you can check these options provided by RadGrid:

    1. GridTemplateColumn which will repeat the same template for every record:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/columns/column-types#template

    3. Grouping functionality:
    http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/grouping/group-footers/defaultcs.aspx

    4. NestedViewTemplate:
    http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/hierarchy-with-templates/defaultcs.aspx

    5. DetailItemTemplate:
    http://demos.telerik.com/aspnet-ajax/grid/examples/columns-rows/rows/detailitemtemplate/defaultcs.aspx

    If the grid styles interfere with your inner custom styles, you can increase the CSS specificity of your own rules.

    Generally, the most suitable control for such custom layout is the RadListView:
    http://demos.telerik.com/aspnet-ajax/listview/examples/appearancestyling/customlayouts/defaultcs.aspx
    http://demos.telerik.com/aspnet-ajax/listview/examples/appearancestyling/predefinedlayouts/defaultcs.aspx

    I hope this will prove helpful.


    Regards,
    Eyup
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Chris
    Chris avatar
    13 posts
    Member since:
    Dec 2011

    Posted 09 Aug 2017 in reply to Eyup Link to this post

    Hi Eyup,

    Thanks for the info.  Most of the links look like they provide extending or overwriting current css where as I'm looking to disable it for certain elements within the grid. I'm not entirely sure how to do this as like I said the styling works perfectly outside of the grid but inside it seems to get overwritten by the grid style.  I'll keep testing and see if I can figure something out.

    Thanks

Back to Top