 |
| ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

June 9th, 2009, 06:48 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You still have an incorrect GetList mthod as it still has paramaters like , int startRowIndex, int maximumRows
Also, are you aware of the Debugger? Set breakpoints in your code and watch it. See where it breaks; see what code gets hit, see what sortExpression etc contains. I am not your on-line debugger and I can't do thid for you: you need to thoroughly investigate this yourself..... I can ony help in advising what to do....
Cheers,
Imar
|
|

June 9th, 2009, 08:29 AM
|
|
Authorized User
|
|
Join Date: Mar 2009
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I had deleted the parameters ... excuse me I've sent the wrong method!
Now I try with debug...
|
|

June 10th, 2009, 09:57 AM
|
|
Authorized User
|
|
Join Date: Mar 2009
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
SortParmaterName in GetList method is null (I've tried with debug)
|
|

June 10th, 2009, 12:27 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi il_dandi,
This is going to take soooooo long. ;-(
I hate to say it but I am about to give up. I am getting pretty frustrated about this thread because you (we) are not making any progress at all.
You're not providing enough information to me to say something useful, while at the same time you don't seem to have all the skills you need to either figure this out yourself or provide me with the relevant information to help you sort it out. This would be a two-minute job to fix if I were sitting next to you (or if you understood what this was all about) but you're making it nearly impossible with the information you provide. Statements like "SortParmaterName in GetList method is null" hardly add any value to this thread. I am sure it's null sometimes which is by design when the page first loads. But does it stay null? What happens when you sort? What happens after a postback? Do you even get any data at all? Did you set the right parameters on all the controls? Can you see the Sorting event fire at the Grid? What's on the call stack when you debug GetList (that is, who calls GetList). And so on and so forth. Why don't you explain exactly what you are doing?
I am not sure what you expect from me but I hope you understand I cannot look into your head or IDE and see what's going on. I can only see what you're posting here which is not a lot. Please realize I cannot run your code to see what goes wrong as I only have fragments of it that don't compile let alone run. So, all I see is what you post here.
Without this information I can't help you. Maybe this whole n-layer thing is a bridge too far for you at the moment? My advise: get a better understanding of what you're doing before you do it. This is taking you way more time than it should which is a waste of your resources and time. Having a firm understanding of the debugger, Visual Studio, .NET in general and the ASP.NET post back architecture and control design in particular are crucial if you want to build something like an N-Layer ASP.NET application.
Maybe I sound a bit harsh, but that's not my intention. I just don't know how to help you otherwise.
Cheers,
Imar
|
|

June 10th, 2009, 12:48 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
One more thing (or actually a few things).
1. I don't understand why this code even works. Your latest GridView doesn't even set the DataSourceID so how does it gets its data at all?
2. The GridView doesn't have AllowSorting set so how does it know how to sort? How come your column headers are clickable?
3. I copied most of your source to a new project, deleted what wasn't relevant, cooked up a custom version of GetList that returns some random PDR items, set AllowSorting and a DataSourceID on the GridView and bham, bingo, instant sorting. Note I don't have any other code in Code Behind. Just a simple GridView, an ODS and a PDR, PDRCriteria and PDRManager class in App_Code and nothing more. Everything works as expected; so the problem must be in something (or some code) you're not showing or telling us.
|
|
 |