Ok so I have a custom tree view control. It has a list of 'group' names for grouping the _datasource in root/child/.../child relationships.
In a thread, it is looking for changes to the database and updating the _datasource and re-rendering the tree view every so often (8 seconds).
There's also a whole other host of things it does on initial drawing and re-drawing. I have to remember which nodes were expanded/collapsed.
I also have checkboxes out to the far right of each node for particular use and they can be enabled/disabled for each level.
Also, the text of the node changes on each level depending on certain criteria.
It's fine with small sub sets of records. But once you get into the 100's it starts to get slow on refresh. The slowness is due to a
combination of volume of changes to the database and volume of records in the resulting _datasource.
I'm ordering the _datasource by the 'group' names in the control's 'group' list, in order (0,1,2). Then I loop through the _datasource and build the entire tree.
After I build the entire tree I go through and expand/collapse, color, check as needed and then actually add the items to a panel.
I'm just not sure how I could speed this up. Because once I've drawing these nodes to the panel in treeview (.Location and etc), I don't think I can
simply move down the other controls if I needed to insert (a root node with children for example) a new root node into the middle of the list.
I could just tack them onto the end, but the tree structure is like so:
- Date
--- Docket and Name
----- Document Name 1
----- ...
----- Document Name N
And unfortunately, they need to be ordered by date.
So, any advice or tips would be much appreciated.
Thanks a lot,
Justin
In a thread, it is looking for changes to the database and updating the _datasource and re-rendering the tree view every so often (8 seconds).
There's also a whole other host of things it does on initial drawing and re-drawing. I have to remember which nodes were expanded/collapsed.
I also have checkboxes out to the far right of each node for particular use and they can be enabled/disabled for each level.
Also, the text of the node changes on each level depending on certain criteria.
It's fine with small sub sets of records. But once you get into the 100's it starts to get slow on refresh. The slowness is due to a
combination of volume of changes to the database and volume of records in the resulting _datasource.
I'm ordering the _datasource by the 'group' names in the control's 'group' list, in order (0,1,2). Then I loop through the _datasource and build the entire tree.
After I build the entire tree I go through and expand/collapse, color, check as needed and then actually add the items to a panel.
I'm just not sure how I could speed this up. Because once I've drawing these nodes to the panel in treeview (.Location and etc), I don't think I can
simply move down the other controls if I needed to insert (a root node with children for example) a new root node into the middle of the list.
I could just tack them onto the end, but the tree structure is like so:
- Date
--- Docket and Name
----- Document Name 1
----- ...
----- Document Name N
And unfortunately, they need to be ordered by date.
So, any advice or tips would be much appreciated.
Thanks a lot,
Justin