is neither a DataColumn nor a DataRelation for table Table on RadGrid

by ebarcza 6/28/2011 2:41:00 AM

This is an error I was receiving on a RadGrid when filtering
is neither a DataColumn nor a DataRelation for table Table on RadGrid

I was using a GridTemplateColum and I was binding a label to a data field. I then turned on GridFiltering by setting AllowFilteringByColumn="True" on the Grid properties.

When I tried to run a filter on this field:

 <telerik:GridTemplateColumn HeaderText="Contract Min Fee" SortExpression="MinFee"  >
     <ItemTemplate>
         <asp:Label ID="lblContractMinFee" runat="server" Text='<%# Bind("MinFee", "{0:C}") %>'></asp:Label>
     </ItemTemplate>
     <FooterTemplate>
         <asp:Label runat="server" ID="lblContractMinFeeTotal"></asp:Label>
      </FooterTemplate>
      <ItemStyle HorizontalAlign="Right" />
  </telerik:GridTemplateColumn>
I received this error is neither a DataColumn nor a DataRelation for table Table on RadGrid 
In order to fix this error I had to define a datafield on the GridTemplateColumn markup, like this:
<telerik:GridTemplateColumn HeaderText="Contract Min Fee" SortExpression="MinFee" DataField="MinFee" >
     <ItemTemplate>
         <asp:Label ID="lblContractMinFee" runat="server" Text='<%# Bind("MinFee", "{0:C}") %>'></asp:Label>
     </ItemTemplate>
     <FooterTemplate>
         <asp:Label runat="server" ID="lblContractMinFeeTotal"></asp:Label>
      </FooterTemplate>
      <ItemStyle HorizontalAlign="Right" />
  </telerik:GridTemplateColumn>

Tags: ,

Finding Latest Objects Modified in SQL Server

by ebarcza 6/7/2011 12:20:00 PM
Simple little script to find all objects modified in the last 5 days

SELECT name AS object_name
,SCHEMA_NAME(schema_id) AS schema_name
,type_desc
,create_date
,modify_date
FROM sys.objects
WHERE modify_date > GETDATE() - 5
ORDER BY modify_date;
GO

Tags:

SQL Server Reporting Services

Arrow keys don't work in excel

by ebarcza 6/1/2011 12:28:00 PM
If your arrows keys don't move you from cell to cell anymore hit the scroll lock key once

Tags:

Excel Programming

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  November 2017  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Recent comments

Tags

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017

Sign in