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

new User

1 Answer 113 Views
Grid
This is a migrated thread and some comments may be shown as answers.
P
Top achievements
Rank 1
P asked on 18 Jul 2012, 08:28 PM
This is my first stab at grid. I am experienced at asp but I cant seem to create a simple example

The page is simply

-------------------------------------------------------------------------------------------------
<%@ Page Language="c#" CodeFile="TelerikGrid.aspx.cs" Inherits="Telerik.GridExamplesCSharp.Hierarchy.NestedViewTemplate.DefaultCS" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Charting" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body class="BODY">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:NewtonBidsConnectionString %>" 
        SelectCommand="SELECT DISTINCT * FROM [t2]"></asp:SqlDataSource>
    </body>
</html>
-------------------------------------------------------------------------------------------------

code behind is empty ie

-------------------------------------------------------------------------------------------------

using System;
using Telerik.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI;


namespace Telerik.GridExamplesCSharp.Hierarchy.NestedViewTemplate
{
    public partial class DefaultCS : System.Web.UI.Page
    {


 
    }
}
-------------------------------------------------------------------------------------------------


the table t2 is a very simple table with 10 columns colum0 being unique


When I add Ragrid in to the source page and select the above datasource I get the following ( in summary.. )

RadGrid - RadGrid1System.Web.HttpException (0x80004005): 'MasterTableView' could not be initialized. Details: 'Columns' could not be initialized. Details: 'Columns' could not be added to the collection. Details: 'Column 0' could not be set on property 'UniqueName'. ---> System.Web.HttpException (0x80004005): 'Columns' could not be initialized. Details: 'Columns' could not be added to the collection. Details: 'Column 0' could not be set on property 'UniqueName'. ---> System.Web.HttpException (0x80004005): 'Columns' could not be added to the collection. Details: 'Column 0' could not be set on property 'UniqueName'. ---> System.Web.HttpException (0x80004005): 'Column 0' could not be set on property 'UniqueName'. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: UniqueName cannot contain spaces at Telerik.Web.UI.GridColumn.set_UniqueName(String value) --- End of inner exception stack trace --- at 


What step am I missing ?

thanks

1 Answer, 1 is accepted

Sort by
0
Jagat
Top achievements
Rank 1
answered on 18 Jul 2012, 11:19 PM
Did you try removing the space from the uniqueName.
UniqueName = 'Column0' instead of 'Column 0'
Tags
Grid
Asked by
P
Top achievements
Rank 1
Answers by
Jagat
Top achievements
Rank 1
Share this question
or