Scenario:
I have a solution with six different projects. The only ones that are of immediate consideration for this issue are the main web application, and the ORM project. In a blank page I added the following:
- RadScriptManager
- RadGrid
- OpenAccessDataSource
I configured the datasource to look at a view in the database. I then connect the grid to use the OA datasource. The sample grid contains two columns: an ID field, and a date field. I need to be able to sort the data as it is bound to the grid so that it is not in an unusable state when the page loads. If I set a sort order in the OA datasource, the page loads with the sort order as expected. However, if you then try to sort the column differently, you get the following error:
A column has been specified more than once in the order by list. Columns in the order by list must be unique.
Statement(s) could not be prepared.
Resorting works if I set the order in the SQL view, but this is not an acceptable solution. We have many pages that rely on a single view, and need to sort pages differently.
The next error is just as critical to us and is, I think, closely related. With a standard ADO.NET datasource I am able to use the between filter in the radgrid for date columns. However, once I added OA ORM, I encounter the following error when I try to use "1/1/10 2/1/10" (obviously without the " marks) as a between filter:
String was not recognized as a valid DateTime.
The database column is defined as a DateTime, and I am not using a GridDateTimeColumn.
Please shed some light on these issues so I may continue to use your products.
HTML
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="Accidents_test" %> |
<%@ Register Assembly="Telerik.OpenAccess.Web" Namespace="Telerik.OpenAccess" TagPrefix="telerik" %> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head runat="server"> |
<title></title> |
</head> |
<body> |
<form id="form1" runat="server"> |
<div> |
<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True" |
AllowSorting="True" DataSourceID="OpenAccessDataSource1" GridLines="None"> |
<MasterTableView AutoGenerateColumns="False" DataKeyNames="RailItemID" |
DataSourceID="OpenAccessDataSource1"> |
<RowIndicatorColumn HeaderStyle-Width="20px" /> |
<ExpandCollapseColumn HeaderStyle-Width="20px" /> |
<Columns> |
<telerik:GridBoundColumn DataField="RailItemID" DataType="System.Int32" |
HeaderText="RailItemID" ReadOnly="True" SortExpression="RailItemID" |
UniqueName="RailItemID"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="InstallationDate" |
HeaderText="InstallationDate" SortExpression="InstallationDate" |
UniqueName="InstallationDate"> |
</telerik:GridBoundColumn> |
</Columns> |
</MasterTableView> |
</telerik:RadGrid> |
<telerik:OpenAccessDataSource ID="OpenAccessDataSource1" runat="server" |
ObjectContextProvider="Rail.ORM.RailObjectProvider, Rail.ORM" |
TypeName="Rail.ORM.ViewCrossing" OrderBy="InstallationDate DESC" /> |
</div> |
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server" /> |
</form> |
</body> |
</html> |
There is no C#, or custom attributes in the ORM.
Thanks,
Nathan