New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Render Modes

CategoryName  
Product IDProduct NameCategory IDCategory NameUnit PriceDiscontinuedQuantity Per UnitUnits In Stock
Page size:
 77 items in 8 pages
CategoryName: Grains/Cereals (... group continued from the previous page. Showing 4 of 7 items.)
 52Filo Mix5Grains/Cereals7.0016 - 2 kg boxes38
 56Gnocchi di nonna Alice5Grains/Cereals38.0024 - 250 g pkgs.21
 57Ravioli Angelo5Grains/Cereals19.5024 - 250 g pkgs.36
 64Wimmers gute Semmelknödel5Grains/Cereals33.2520 bags x 4 pieces22
CategoryName: Meat/Poultry
 9Mishi Kobe Niku6Meat/Poultry97.0018 - 500 g pkgs.29
 17Alice Mutton6Meat/Poultry39.0020 - 1 kg tins0
 29Thüringer Rostbratwurst6Meat/Poultry123.7950 bags x 30 sausgs.0
 53Perth Pasties6Meat/Poultry32.8048 pieces0
 54Tourtière6Meat/Poultry7.4516 pies21
 55Pâté chinois6Meat/Poultry24.0024 boxes x 2 pies115
  • Render Mode
Render mode
Classic vs. Light rendering
Classic Lightweight
Markup Size
CSS Size 29.50 KB 23.70 KB
Image Sprite Size 8.64 KB 0 KB*

This demo showcases the two different rendering modes of Telerik ASP.NET Grid control: Classic and Lightweight.

  • Classic rendering is the long-standing rendering mode of the control, with extensive use of table elements for the layout and images for backgrounds, icons, etc.
  • Lightweight rendering leverages HTM5 and CSS3, but the control may lose its rounded corners, gradients and shadows in non-modern browsers.

The default render mode of the control is Classic and you have the option to either explicitly set it to Lightweight or leverage the Auto mode to have the control choose the best rendering based on the user's browser.

Note: In order to provide optimal experience for your end users, we recommend that you use only one type of render mode for a control on a given page. For example, if you have two instances of RadGrid on the page, it will be best if both of them use the same render mode.

Note: The Material skin is available only for the modern Lightweight render mode. Change the skin or the mode to properly visualize the demonstrated control.

Notes on the statistics:
The markup size is calculated automatically for the currently selected RenderMode, so if you want to compare the markup size of both modes, you could change the selection in RenderMode radio button placed in the demo configurator.

* Lightweight rendering uses shared font icons across all controls (TelerikWebUI).

  • DefaultVB.aspx
  • DefaultVB.aspx.vb
  • styles.css
<%@ Page Title="" Language="VB"  AutoEventWireup="false" CodeFile="DefaultVB.aspx.vb" Inherits="Grid.Examples.RenderModes.DefaultVB" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>

<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div id="Div1" class="demo-container" runat="server">
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function pageLoad() {
                    var grid = $find("<%=RadGrid1.ClientID%>");
                    var renderMode = grid.get_renderMode();
                    var gridMarkupSize = Math.round((grid.get_element().innerHTML.length / 1024) * 100) / 100 + " KB";
                    document.getElementById("<%=ClassicSize.ClientID%>").innerHTML = renderMode == 1 ? gridMarkupSize : "-";
                    document.getElementById("<%=LightweightSize.ClientID%>").innerHTML = renderMode == 1 ? "-" : gridMarkupSize;
                }
            </script>
        </telerik:RadCodeBlock>

        <asp:Panel EnableViewState="true" runat="server" ID="Panel1">
        </asp:Panel>

         <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"        
            SelectCommand="SELECT [ProductID], [ProductName], [Products].[CategoryID], [Categories].[CategoryName] as CategoryName, [UnitPrice], [Discontinued], [QuantityPerUnit], [UnitsInStock] FROM [Products] JOIN Categories ON Products.CategoryID=Categories.CategoryID">
        </asp:SqlDataSource>
    </div>

    <qsf:ConfiguratorPanel runat="server" ID="ConfiguratorPanel1" Title="Render Mode">
        <Views>
            <qsf:View>

                <qsf:ConfiguratorColumn ID="ConfiguratorColumn1" runat="server" Title="Render mode" Size="Narrow">
                    <qsf:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" CssClass="fb-group">
                        <asp:ListItem Value="Lightweight" Selected="True">Lightweight</asp:ListItem>
                        <asp:ListItem Value="Classic">Classic</asp:ListItem>
                    </qsf:RadioButtonList>
                </qsf:ConfiguratorColumn>

                <qsf:ConfiguratorColumn ID="ConfiguratorColumn2" runat="server" Size="Wide" Title="Classic vs. Light rendering">
                    <table class="table" cellspacing="0">
                        <thead>
                            <tr>
                                <th></th>
                                <th>Classic</th>
                                <th>Lightweight</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <th>Markup Size</th>
                                <td>
                                    <asp:Label ID="ClassicSize" runat="server"></asp:Label></td>
                                <td>
                                    <asp:Label ID="LightweightSize" runat="server"></asp:Label></td>
                            </tr>
                            <tr>
                                <th>CSS Size</th>
                                <td>29.50 KB</td>
                                <td>23.70 KB</td>
                            </tr>
                            <tr>
                                <th>Image Sprite Size</th>
                                <td>8.64 KB</td>
                                <td>0 KB*</td>
                            </tr>
                        </tbody>
                    </table>
                </qsf:ConfiguratorColumn>
            </qsf:View>
        </Views>
    </qsf:ConfiguratorPanel>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance