Hello, I have a XamMultiColumnComboEditor with 2 columns (see code below). The data in the comboeditor is sorted on the first column now, but I want to be able to sort on both. (clicking on header Test would result in changing the sort to the column Test and same behavior for column product)
<ig:XamMultiColumnComboEditor Name="cmbTest" ItemsSource="{Binding TestCollection}" DisplayMemberPath="Value.DisplayMember" SelectedItem="{Binding SelectedTest,Mode=TwoWay}" AutoGenerateColumns="False"> <ig:XamMultiColumnComboEditor.Columns> <ig:TextComboColumn Key="Value.Description" HeaderText="Test" Width="*" /> <ig:TextComboColumn Key="Value.Product" HeaderText="Product" Width="*" /> </ig:XamMultiColumnComboEditor.Columns> </ig:XamMultiColumnComboEditor>
How can I do this with this editor?
Hello Dries,
After some research Multiple Sorting has been determine as a new Product Idea. I have sent your Product Idea directly to our product management team. Our product team chooses new Product Ideas for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested ideas, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your idea is chosen for development, you will be notified at that time. Your reference number for this Product Idea is PI13060146
If you would like to follow up on your Product Idea at a later point, you may contact Developer Support management via email. Please include the reference number of your Product Idea in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com
I have been looking into the requirement that you are having and I managed to implement the sorting functionality for the XamMultiColumnComboEditor.
To allow sorting the editor, when clicking on the headers of the columns, you should create a class that derives from the XamMultiColumnComboEditor and expose its protected DataManger property. Using the DataManager, you can sort the items in the editor, by adding SortContext objects to the DataManagerBase’s Sort collection.
After exposing the property, you can create a style for the ComboHeaderCellControl and handle the MouseLeftButtonDown event, using an EventSetter. In the event handler for the event, you can get the column that should be sorted and add a SortContext for this column.
I am attaching a sample application that shows how you can implement this approach.
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir, MCPD
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
I have a XamMultiColumnComboEditor that is bound to a dataview and I cannot figure out how to sort it. I tried to just sort the dataview but that does not seem to be working.
Try this
Dim dv As DataView = getMyDataView()
dv.Sort = "COLUMN_NAME"
Dim dt As DataTable = dv.ToTable()
myXamMultiColumnComboEditor.ItemsSource = dt.DefaultView()
Thank you. That partially fixed the problem but it lead me to change my Select statement and added an 'Order by' statement which fixed it.