jonboy_moore Posted February 3, 2004 Posted February 3, 2004 i have a function that binds data to a listbox using a dataview ( using a dataset filled by an external xml file) however when i try to sort using the "orderNo" field it sorts it in a very odd way...ie: 1 11 12 13 14 2 3 4 5 6 7 .....etc does anybody know how to order these numerically (i really do need to keep this in a dataview) Cheers Quote
Administrators PlausiblyDamp Posted February 3, 2004 Administrators Posted February 3, 2004 Is the underlying DB using a string for the orderNo field? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Administrators PlausiblyDamp Posted February 3, 2004 Administrators Posted February 3, 2004 Does the XML file have a valid schema associated with it? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
jonboy_moore Posted February 3, 2004 Author Posted February 3, 2004 .....i dont think so, ill check it out and see if i can build one, cheers! Quote
jonboy_moore Posted February 3, 2004 Author Posted February 3, 2004 well done that man, they dont call u an expert for nutin Quote
Varba Posted February 4, 2004 Posted February 4, 2004 (edited) Same Topic, New Question I'm actually having a very similar problem, from a different set of circumstances. I'm filling in a dataview from a sql statement, and adding in calculated fields using the dataview.AddNew() method. After all the rows are in the dataview, I set the Sort property. Originally I set it to use the "sort" column that I had created to have the report display properly. It was showing up as follows: 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, (ect.), 4 I found it kind of odd so I tried different kinds of sorts, descending, switching to other columns for the sort (both alpha and numeric) but the one row always stays in the last position when I bind the dataview to the datagrid. Has anyone else encountered something similar to this? Or have any hints/suggestions on how to get the last row in the dataview sorting with the rest of them? :) Thanks, V *edit* I have since detirmined that the row in question is the last row that is inserted using the dataview.AddNew() method. I'm not sure what exactly that would do to cause a difference though. Edited February 4, 2004 by Varba Quote
Varba Posted February 6, 2004 Posted February 6, 2004 Just in case anyone else runs into this issue, I thought I'd post my work around to the issue and close out the question. Whatever the cause is (It may be something I unwittingly did incorrectly with the dataview...) in this case, whichever row is added last will not sort. When I add an entirely blank row to the dataview, that row becomes the "non-sorting" one. If that row is then immediatly deleted, all the rows in the view sort properly. It's an ugly work around in my opinion, but I couldn't find another way. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.