My favorites | Sign in
Project Logo
             
New issue | Search
for
| Advanced search | Search tips
Issue 58: Bug in EntityGridView
5 people starred this issue and may be notified of changes. Back to list
Status:  Accepted
Owner:  ----
Type-Defect
Priority-High
Platform-SQL


Sign in to add a comment
 
Reported by palegra, Jun 24, 2008
What steps will reproduce the problem?
1. Set AllowMultiColumnSorting property to true
2. Set DefaultSortColumnName property to any field
3. Set DefaultSortDirection property to Descending

What is the expected output? What do you see instead?
This throw an exception: Incorrect syntax near the keyword 'DESC'.

What version of .netTiers and CodeSmith are you using?
i'm using rev744

Please provide any additional information below.
Is generated a wrong orderby clause like this: '[AnyField] DESC DESC'
 
Comment 1 by diegogravi, Aug 20, 2008
What is happening here is that the orderby clause received at the second time you
visit the entity display list aspx, will be populated from the
gridviewsearchpanelstate where a orderby clause was persisted and will try to
construct the orderby over it. 
Example: 
1st time >> [AnyField] DESC
2nd time >> [AnyField] [AnyField] DESC DESC

and so on...
The error seems to be on the way it is creating the orderby clause with what is in
the viewstate of the gridviewsearchpanelstate.

Hope this helped clarifying the issue :)

Regards,
DiegoGravi
Comment 2 by bniemyjski, Nov 30, 2008
Could you guys try the following fix and let me know if it works:

        protected string ModifySortExpression(string[] sortColumns, string
sortExpression)
        {
			string ascSortExpression = sortExpression;
			string descSortExpression = sortExpression;
			 
			if(!sortExpression.Contains("ASC"))
            	ascSortExpression = String.Concat(sortExpression, " ASC ");
            
			if(!sortExpression.Contains("DESC"))
				descSortExpression = String.Concat(sortExpression, " DESC ");
			
inside of EntityGridView.cs.cst
Status: Accepted
Owner: bniemyjski
Comment 3 by palegra, Jan 13, 2009
I get the same error!
Comment 4 by bniemyjski, Feb 02, 2009
palegra,

Did you update the template with the code I posted?

-Blake
Comment 5 by palegra, Feb 04, 2009
Yes!
Comment 6 by bniemyjski, May 25, 2009
(No comment was entered for this change.)
Owner: ---
Labels: -Priority-Medium Priority-High
Comment 7 by bniemyjski, May 25, 2009
(No comment was entered for this change.)
Labels: Platform-SQL
Sign in to add a comment

Hosted by Google Code