
axum
Avatar/Signature-
Posts
41 -
Joined
-
Last visited
Personal Information
-
.NET Preferred Language
C#
axum's Achievements
Newbie (1/14)
0
Reputation
-
Oh FANTASTIC, you're a STAR!!! Oh wait..... You're only 4 ½ years too late!!!
-
Nope, i tried the DataView route and no improvement whatsoever.. i understand sorting on a string is more the norm, but using strings to do anything is gonna be slower than handling numbers surely? The Sorted List automatically sorts alphabetically, believe me it works fine and it's rapid, as it works very similar to a Hashtable. Doesn't using the DefaultView sort depend on having primary keys setup or something? The problem is when i'm sorting i'm sorting the WHOLE set of data and NOT the set of Data that is returned via the .Select method. I'm sure i could reassign the DataTable to a new one after the Select then sort on that, but why not just use a Sorted List that is specifically designed to sort? Axum
-
It's obviously due to the fact that the DataTable holds my ENTIRE dataset, thus when you elect to do a Sort it has to perform a TEXTUAL sort on all the records, and i can't believe that you have never encountered a slowdown due to this??!! It's one of the things NOT to do, use strings to do any kind of comparisons/sorting as it's just slower. Of course the actual SELECT is quick, but it's the sort that's not! That's why i'm populating my Sorted List with the contents of my DataTable with the Select operation performed RATHER than sort the entire DataTable... Any clearer? Axum
-
no, if you read on i explain that it's the Textual Sort - i.e the .Select(selectSQL, "TITLE") bit - the actual "TITLE" sort is what's slowing it down. But have no fear, i've sorted this by just omitting the "TITLE" bit out, then looping through the records and adding them to a Sorted List, this works MUCH faster :) Cheers Axum
-
Ok, found a way round this small problem if anyone is interested..! Basically i retrieved my Row Collection from my DataTable by using the .Select syntax, if you remember it was adding in the "Sort" property that was slowing the whole thing down. So all i did was loop through the records retrieved by my DataTable.Select call, and add them into a SortedList object. But i added the Title as the Key and the ID as the value, thus keeping the alphabetical sorting intact. Then i just looped round the SortedList to build my TreeView as normal, hey presto :) Just for anyone's information.. Axum
-
Hi, is there any way to alphabeticaly sort a TreeView's nodes? And no, i can't add the id's in in the correct order as the data is added to on a frequent basis. Sorting within the DataTable is taking WAY too long! Thanks Azza
-
errr, no, not one little bit, it's remarkably similar as what i already wrote down : dTable.Select(selectSql,"Title"); but you've just split into 2 unnecessary lines! thanks anyway!
-
err yes, but you can't use an ORDER BY query in a Select SQL statement when using it against a DataTable can you?! This is my Select statement i am using for my DataTable : selectSql = dTable.Columns[0].ToString() + "='" + currentParent + "' and " + dTable.Columns[1].ToString() + "<> '" + currentParent + "' ORDER BY title"; dRowColl = dTable.Select(selectSql); foreach(DataRow dRow in dRowColl) { // do something } But this returns : Syntax error: Missing operand after 'ORDER' operator when executing the dTable.Select statement. I didn't think it was possible to use this ORDER BY SQL when using a DataTable?
-
Hi, i have a TreeView that has the usual Parent > Child relationship. I populate my Treeview by using a DataAdapter to fill a DataTable by running a Stored Proc. This Stored Proc returns a list of ID's Ordered by their Title, so they will appear alphabetically. But when i insert the records into the DataTable it seems to order them by ID and lose their original ordering. I know i can use the Sort method on the DataTable : dRowColl = dTable.Select(selectSql,"Title"); but using this has slowed down my program immensely! Obviously as it's doing a textual sort, it's running about 5 times as slow. My selectSql above is the usual "parentID='CurrentParent' and childID <> 'CurrentParent'" to select the Parent > Child relationships. What i really would like to do is to add an "ORDER BY" bit to the end but you can't do this can you? Has anyone had similar problems or know's of a way to speed things up? Many thanks..
-
Hi, i have a TreeView that has the usual Parent > Child relationship. I populate my Treeview by using a DataAdapter to fill a DataTable by running a Stored Proc. This Stored Proc returns a list of ID's Ordered by their Title, so they will appear alphabetically. But when i insert the records into the DataTable it seems to order them by ID and lose their original ordering. I know i can use the Sort method on the DataTable : dRowColl = dTable.Select(selectSql,"Title"); but using this has slowed down my program immensely! Obviously as it's doing a textual sort, it's running about 5 times as slow. My selectSql above is the usual "parentID='CurrentParent' and childID <> 'CurrentParent'" to select the Parent > Child relationships. What i really would like to do is to add an "ORDER BY" bit to the end but you can't do this can you? Has anyone had similar problems or know's of a way to speed things up? Many thanks..
-
Is it at all possible to set a bgcolour for a TreeView? I don't think it is personally, and i don't mean by looping through all the nodes and giving them a background... or have i missed something? Thanks Axum
-
many thanks, i tried the panel and it never worked properly so i'll give your DIV option a try, cheers! Axum
-
Hi, i have an aspx page, that will call another aspx page as a popup. Once processing has been done within this pop-up i need to close it and REFRESH (reload) the parent page. Any ideas how i can do this...? Also i was wondering, if, from the parent page you can get access to the controls within the pop-up page.....? Many thanks Axum
-
Hi (again!), ok i have a "display section" in the top half of my page and a TreeView control in the other half, when nodes are checked on it, and a "Save" button is clicked, i go off and do some processing but need to display the checked nodes to the user... Problem is i want to be able to limit the size of the screen this takes up and ideally for some vertical scrollbars to appear so they can scroll through the list, thus NOT pushing the treeview out of view. I HAVE got this working fine with my TreeView by giving it a height percentage and then a STYLE="POSITION: absolute", which means if there are loads of nodes, scrollbars appear.... Any good tricks, or controls that will allow me to do this? Many thanks Axum
-
many thanks mate, can't believe it's as simple as that one line :) Ah well, gotta know your javascript i guess! Axum