Since MultiBinding is not supported directly on GridViewDataColumns, I have the following:
This works absolutely fine but I have to cater for the converter being called more times than I'd expect when editing the underlying collection. If I have 5 rows of data then the converter is called 10 times. The last 5 times are for the 5 rows of data but the first 5 times are for 5 sets of DependencyProperty.UnsetValue being passed into the converter.
Looking at the callstack, this seems to be caused by a call to ClearRow in the GridViewRowItem which is eventually hit as part of the ItemsSourceChanged event.
Can anyone explain why the grid needs to clear every row before assigning the new value? This doesn't happen with a non-multi binding, the converter is only called 5 times after an edit. Is it something to do with the fact that I'm using a CellTemplate?
Cheers! :)
<telerik:RadGridView ItemsSource=
"{Binding TestGridData}"
Height=
"150"
Margin=
"5"
AutoGenerateColumns=
"False"
ShowGroupPanel=
"False"
>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header=
"StringValue"
>
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate >
<TextBlock>
<TextBlock.Text>
<MultiBinding Converter=
"{view:TestConverter}"
>
<Binding Path=
"StringValue"
/>
<Binding Path=
"IntValue"
/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
This works absolutely fine but I have to cater for the converter being called more times than I'd expect when editing the underlying collection. If I have 5 rows of data then the converter is called 10 times. The last 5 times are for the 5 rows of data but the first 5 times are for 5 sets of DependencyProperty.UnsetValue being passed into the converter.
Looking at the callstack, this seems to be caused by a call to ClearRow in the GridViewRowItem which is eventually hit as part of the ItemsSourceChanged event.
Can anyone explain why the grid needs to clear every row before assigning the new value? This doesn't happen with a non-multi binding, the converter is only called 5 times after an edit. Is it something to do with the fact that I'm using a CellTemplate?
Cheers! :)