View previous topic :: View next topic |
Author |
Message |
floele
Joined: 04 Aug 2008 Posts: 22
|
Posted: Mon Aug 04, 2008 6:15 pm Post subject: Event: ColumnReordered |
|
|
Hi,
I'm currently evaluating your control, and I noticed that a ColumnReordered event is missing, although even the standard ListView has such an event.
Could something like this be added?
Preferably, there would be both a ColumnReordered and a ColumnReordering event. Unfortunately, the ColumnReordered event from the standard ListView is bugged and is in fact a ColumnReordering event which makes things unnecessarily difficult.
Regards,
Florian |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Aug 04, 2008 10:26 pm Post subject: |
|
|
Virtual Tree has the SortColumn changed event which is raised when the sort column (or order of the sort column) is changed. _________________ Infralution Support |
|
Back to top |
|
|
floele
Joined: 04 Aug 2008 Posts: 22
|
Posted: Mon Sep 01, 2008 6:33 am Post subject: |
|
|
I have just tried this event, but it doesn't do what I need. I need an event which fires when *any* column has been moved to a new location, not necessarily a sort column.
Also: Why don't you have a default sorting feature? Basically, 99% of the data you usually put into a list view (or tree view) could be sorted using the IComparable interface. In your samples however, you define a FileInfoComparer and DirectoryInfoComparer which is rather complex and wouldn't be necessary.
As an example, a free control which does that is the ObjectListView - once you have defined the binding, it is able to sort virtually any data you put into it automatically (and there is not much code involved with this). This is really really useful |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Sep 01, 2008 9:31 am Post subject: |
|
|
Quote: | I have just tried this event, but it doesn't do what I need. I need an event which fires when *any* column has been moved to a new location, not necessarily a sort column. |
You can attached to the VirtualTree.Columns.ListChanged event to get notification of when a column has been moved or changed (rather than sorted).
Quote: | Also: Why don't you have a default sorting feature? Basically, 99% of the data you usually put into a list view (or tree view) could be sorted using the IComparable interface. In your samples however, you define a FileInfoComparer and DirectoryInfoComparer which is rather complex and wouldn't be necessary. |
The reason Virtual Tree doesn't implement a default sorting mechanism like you describe is because the only way to implement sorting at this level requires iterating through every row of the tree. This would defeat the primary design goal for Virtual Tree which is performance. If your data is coming from a database then it is much more efficient to have the database do the sorting for you (using its indexes) then to extract the data and sort it using IComparable. _________________ Infralution Support |
|
Back to top |
|
|
|