Hi,
I'm using a BindingSource with the WinTree.
The bindingsource is bound to a datatable and the wintree is bound to the bindingsource.
The problem is, once one of the columns is sorted in the wintree it uses its own sorting mechanism instead of sorting the underlying dataview and therefore the bindingsource is out of sync with the wintree.
Is there a way to tell the wintree to directly sort the underlying datasource so it will remain in sync with the bindingsource ?
thanks.
Hi Kal,
Thank you for contacting Infragistics Developer Support.
Do you want to sort the DataTable itself, when you sort the tree? If that is the case, the .Net binding manager itself doesn’t transfer the sorting to the underlying data source. It can only track the current selected node by setting the SynchronizeCurrencyManager property of the tree to true.
Is that what you are trying to achieve? Generally you would use the data table for persisting your data and let the control itself sort it when presenting it to the user.
I am looking forward to your reply.
yes, I want the dataview itself to be sorted. what happens, once you sort the wintree, when using the bindingnavigator, the order of the records in the bindingsource aren't in the same order as in the wintree.
any solution ?
thanks in advance.
This would be very tricky. In theory, you might be able to trap for when the sorting in the tree changes and then attempt to sort your data set using the same criteria. But in the case where there are duplicate values and the order of two nodes/rows is arbitrary, you might not be able to get it exactly the same in all cases.
The WinGrid has a feature we call External sorting. That is, the grid shows the sort indicates in the column headers and they respond to user action, but the grid doesn't actually sort anything. It simply fires event and allow you to sort your data source and then refresh the grid display. So that way the grid sorting is in synch with the data source. But there is no such feature in the WinTree at this time.
So you might want to consider using a WinGrid if this feature is important to your application.
Hello Kal,
I am just checking about the progress of this issue. Let me know if you need my further assistance on it.
Thank you for using Infragistics Components.
Well, displaying the indicator would be a matter of using a DrawFilter or CreationFilter to draw it yourself. Or another option would be to simply use the HeaderAppearance on the column and apply an Image - assuming you are not already using the image for something else.
You would also have to store the sorted state of the column somewhere - maybe in the column's Tag property. Then, of course, you would have to handle the clicks on the column headers to allow the user to change the sorting.
I must use the wintree control.
if I take care of the sorting, how can I display the sortindicator in the column header ?