Hello,
I've got a problem with the converter(s) in XamDataGrid.
It's a "error reporting system"-grid where i have to write an ID and a translated text in each cell.
Code:
<igWPF:TemplateField Name="Device" Converter="{StaticResource idToErrorConverter}" ConverterParameter="device" Label="{local:TranslateBinding 1206, FallbackValue=Bereich}"> <igWPF:TemplateField.CellValuePresenterStyle> <Style TargetType="{x:Type igWPF:CellValuePresenter}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <Grid > <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="auto" /> </Grid.ColumnDefinitions> <TextBlock Text="{Binding Path=DataItem.Device, Converter={StaticResource idToErrorConverter}, ConverterParameter=device}"/> <TextBlock Text="{Binding Path=DataItem.Device}" /> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </igWPF:TemplateField.CellValuePresenterStyle> </igWPF:TemplateField>
Problem:
If there is the converter set in TemplateField and in CellValuePresenter Template - on update for each cell is the converter called twice -> not optimal for performance.
If i only set the converter in CellValuePresenter the id of the cell is not translated to text by grouping or filtering.
If i only set the converter in TemplatField the id in cell is not translated.
Hello Andreas,
I modified my sample to have both the initial and converted value in one cell and it still supports sorting.
If you require any further assistance on the matter, please let me know.
Sincerely,Radko KolevSenior Software Developer
Hello Radko,
Tahnk you for your answer.
I modified your sample application like i need it.
The ErrorId and the Error-Translation should be in the same cell. So i need a template for the Field.
Sirencely
Andreas
I created a sample application demonstrating how to have a column which has a converted value in it and supports sorting at the same time. The application is attached.
Let me know if I may be of any further assistance.