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

[Solved] DataColumn nor a DataRelation

2 Answers 193 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 2
Darren asked on 10 Dec 2009, 12:53 PM
Hi there,

I've got a gridtemplatecolumn which gives the following error when I try to use the filter.
ERROR: "is neither a DataColumn nor a DataRelation for table DefaultView. "

The column I am trying to filter is:
                    <telerik:GridTemplateColumn HeaderText="Description" EditFormColumnIndex="1" SortExpression="Description" 
                        UniqueName="Description"
                        <ItemTemplate> 
                            <%#Eval("Description") %> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn> 

Thanks,

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 Dec 2009, 01:17 PM
Hello Darren,

How do you bind your grid? If you are using the SimplaeData binding techniques then probably you can switch to advanced binding with NeedDataSource event handling instead of using simple binding with DataBind calls. You can use advanced binding through the NeedDataSource event or data source control as demonstrated in the help link below:
Advanced Data Binding

Hope this helps..
Princy.
0
Darren
Top achievements
Rank 2
answered on 10 Dec 2009, 01:20 PM
Hi Princy,

I am using:
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:RadCMSConnectionString %>" 
            SelectCommand="SELECT * FROM [tblUser]"></asp:SqlDataSource> 

 <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" 
            GridLines="None" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" 
            OnItemCommand="RadGrid1_ItemCommand"
            <PagerStyle Mode="NextPrev" /> 
            <MasterTableView DataKeyNames="UserId" DataSourceID="SqlDataSource1"

Do you still suggest NeedDataSource event?
Tags
Grid
Asked by
Darren
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Darren
Top achievements
Rank 2
Share this question
or