Ticket Q476654
Visible to All Users

How to Sort a GridColumn which uses a MultiBinding Converter

created 12 years ago

I have a GridColumn who's Display Member Binding is defined by a MultiBinding Converter, which gets's its data from 2 other columns. I'd like to be able to sort this column by the results of the MB Converter. How can that be accomplished?

Thanks.

XAML
<dxg:GridColumn Width="60" HorizontalHeaderContentAlignment="Center" Header="Leaves" AllowColumnFiltering="False" > <dxg:GridColumn.DisplayMemberBinding> <MultiBinding Converter="{StaticResource clc}"> <Binding Mode="OneWay" Path="RowData.Row.quantity"/> <Binding Mode="OneWay" Path="RowData.Row.quantityFilled"/> </MultiBinding> </dxg:GridColumn.DisplayMemberBinding> <dxg:GridColumn.EditSettings> <dxe:TextEditSettings HorizontalContentAlignment="Center" DisplayFormat="{}{0:n0}" /> </dxg:GridColumn.EditSettings> </dxg:GridColumn>

Answers approved by DevExpress Support

created 12 years ago (modified 12 years ago)

Hi,
The best way to achieve your goal is to use the SortOrder or SortIndex property.
Feel free to contact us if you need additional information. I will be glad to help you.
Thanks

    Show previous comments (3)
    DevExpress Support Team 12 years ago

      Technically, this problem can be caused by the fact that you are using the ICollectionView datasource. Please check this.
      I am looking forward to your response.
      Thanks

        I am in fact using an ICollectionView as a Source. I need to be able to do some quick filtering, so that made sense. Is there a workaround, or should I switch to a standard ObservableCollection?

        DevExpress Support Team 12 years ago

          This limitation is caused by the specifics of work with the ICollectionView collection. Please review the Silverlight grid column filtering doesn't work for enumerated column data (when using CollectionViewSource). thread to get more information.
          I am afraid it is impossible to implement the required functionality using ICollectionView. In the meantime, would you please clarify why you need to use this collection? Perhaps we can provide you with a more appropriate solution.
          Thanks

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.