This is a migrated thread and some comments may be shown as answers.

XML formatting within RadGrid

2 Answers 103 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 31 Jul 2017, 02:58 AM

Hello,

I would like to be able to display formatted within a RadGrid using either google prettify or .  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 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 03 Aug 2017, 05:32 AM
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.
0
Chris
Top achievements
Rank 1
answered on 09 Aug 2017, 12:15 PM

Hi Eyup,

Thanks for the info.  Most of the links look like they provide extending or overwriting current  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

Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Chris
Top achievements
Rank 1
Share this question
or