Sorting Listview column on celltemplate that has multibinding

Aug 24, 2011 at 3:34 PM

My listview column has a celltemplate that has a multibinding on it. So I have spun my wheels for hours trying to figure out how to sort it. So the contents of the column are not using one simple property in my viewModel. It has to be sorted on the actually values in the listview. Can this be done with Linq? I would truly appreciate some help!! Thanks!

<DataTemplate x:Key="ExistsCell">
                <TextBlock 
                    Margin="17,0">  
                    <TextBlock.Text> 
                        <MultiBinding Converter="{StaticResource ExistsAndOverwriteConverter}">  
                            <Binding Path="IsSelected" RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type ListViewItem}}" />
                            <Binding Path="AlreadyExists" />
                    </MultiBinding>               
                    </TextBlock.Text>
                </TextBlock>
            </DataTemplate>
And the column:
  <GridViewColumn x:Name="colExists"                                           
        CellTemplate="{StaticResource ExistsCell}" >
        <GridViewColumnHeader
               Content="{StaticResource existsHeader}"                                    
               Visibility="{Binding Path=AddMode, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter=Collapsed}"/>
         </GridViewColumn>