Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
525
XamDataGrid changing text in cells for a column using multibinding, has to be twoway
posted

Hi

I have an implementation where XamDataGrid is being used. In the XamDataGrid I have a column where the value (a number) is to be changed to a corresponding text given some states.

First of all I need to have the multibinding as twoway for it to work ? If using oneway for the multibinding then it stops working.

Secondaylly, it works initially, but when editing a row, which changes the state, sometimes the number is shown instead of the text and this happens when the ConvertBack is called. I really have difficulties to implement a convertBack due to the logic, so I would like to have this to work with oneway. Se below code, where the TypeIdToTextConverter is twoway, and doesn't work if set to oneway.

                            <dP:Field Name="RecordType" FixedLocation="FixedToNearEdge" Width="70">
                                <dP:Field.Settings>

                                        <dP:FieldSettings.EditorStyle>
                                            <Style TargetType="{x:Type igEditors:XamTextEditor}">
                                                <Setter Property="Value">
                                                    <Setter.Value>
                                                        <MultiBinding Converter="{StaticResource TypeIdToTextConverter}" >
                                                            <Binding Path="Cells[RecordType].Value" Mode="OneWay"/>
                                                            <Binding Path="Cells[NonVerifiedData].Value" Mode="OneWay"/>
                                                            <Binding Path="Cells[NormalOperation].Value" Mode="OneWay"/>
                                                            <Binding Path="Cells[CompleteRecord].Value" Mode="OneWay"/>
                                                            <Binding RelativeSource="{RelativeSource AncestorType=dP:XamDataGrid}"  Path="DataContext.DowntimeRecordState" Mode="OneWay"/>
                                                        </MultiBinding>
                                                    </Setter.Value>
                                                </Setter>
                                            </Style>
                                        </dP:FieldSettings.EditorStyle>

How can I make this work ?