RadGrid doesn't support TemplateColumn while Binding to DataTable

4 posts, 1 answers
  1. Ray
    Ray avatar
    8 posts
    Member since:
    Jul 2011

    Posted 06 Jan 2014 Link to this post

    A page uses a RadGrid :
    1. DataBind to a DataTable.(on Page_Load)
    2. GridTemplateColumn , put a RadTextBox (in .aspx file)

    no compile warning or errors, run in IE, the grid  in displayed very strange.
    snapshot pic is here: http://i.imgbox.com/abhkG4MO.png

    1. WebForm1.aspx
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication2.WebForm1" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html>
    <head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <form id="form1" runat="server">
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
            <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" CellSpacing="0" Culture="zh-CN" GridLines="None">
                        <telerik:GridBoundColumn DataField="name" FilterControlAltText="Filter name column" HeaderText="name" UniqueName="name">
                        <telerik:GridTemplateColumn DataField="age" FilterControlAltText="Filter age column" HeaderText="age" UniqueName="age">
                                <telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# Eval("age") %>'></telerik:RadTextBox>

    2. WebForm1.aspx.cs
    using System;
    using System.Data;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    namespace WebApplication2
        public partial class WebForm1 : System.Web.UI.Page
            protected void Page_Load(object sender, EventArgs e)
                    DataTable dt = new DataTable();
                    for (int i = 0; i < 20; i++)
                        DataRow r = dt.NewRow();
                        r["name"] = "name" + (char)('A' + i);
                        r["age"] = i;
                    RadGrid1.DataSource = dt;

  2. Ray
    Ray avatar
    8 posts
    Member since:
    Jul 2011

    Posted 06 Jan 2014 Link to this post

    attach a picture that the grid strange displayed
  3. DevCraft R3 2016 release webinar banner
  4. Answer
    Venelin avatar
    352 posts

    Posted 09 Jan 2014 Link to this post

    Hello Ray,

    Do you use VisualStudio 2013? If so please download the latest internal build where a similar issue was fixed. Please also refer to this forum thread for more information: http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-does-not-render-opening-table-tag-in-visual-studio-2013.aspx

    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  5. Ray
    Ray avatar
    8 posts
    Member since:
    Jul 2011

    Posted 10 Jan 2014 Link to this post

    I'm using VS2013.
    Refer to the thread ,my problem got fixed .
    (Add the element below to my web.conifg appSettings section:<add key="vs:EnableBrowserLink" value="false" />)
    ,Thank you very much!
Back to Top