Bindings Problems with EditControl

I have a WPF app with a tab control. One of the controls shows some code as XML the other as JSON. This is achieved via two edit controls (see below).

Both edit controls are bound in the same way to a parameter whose content can change. The issue is when 'SelectedInstance.ResourceJson' changes then the editcontrol reflects the changes. However when 'SelectedInstance.ResourceXml' changes that edit control does not change - it always shows the first value

What am I doing wrong? I can not understand why one editcontrol works and the other does not.

            <syncfusion:TabItemExt Name="tabOutbound" Header="JSON">
                <Grid>
                    <syncfusion:EditControl Name="editJSON" 
                                Background="White" 
                                DocumentLanguage="Custom"
                                IsReadOnly="True"
                                Text="{Binding SelectedInstance.ResourceJson}"
                                FontFamily="Verdana">
                    </syncfusion:EditControl>
                </Grid>
            </syncfusion:TabItemExt>
            <syncfusion:TabItemExt Name="tabInbound" Header="XML">
                <Grid>
                    <syncfusion:EditControl Name="editXML" 
                                Background="White" 
                                DocumentLanguage="XML" 
                                IsReadOnly="True"
                                Text="{Binding SelectedInstance.ResourceXml}"
                                FontFamily="Verdana"/>
                </Grid> 
            </syncfusion:TabItemExt>

1 Reply

DR Durga Rajan Syncfusion Team May 18, 2018 10:35 AM UTC

Hi Richard, 

Thanks for contacting Syncfusion support. 

We have checked your code sample at our end. We were able to reproduce the reported behavior “Text of the EditControl is not updated properly” at our end and we suggest you to update the binding mode as Twoway to update the text properly. Please find the modified code example from below, 

<syncfusion:TabControlExt Grid.Row="1"> 
            <syncfusion:TabItemExt Name="tabOutbound" Header="JSON"> 
                <Grid> 
                    <syncfusion:EditControl 
                        Name="editJSON" 
                        Background="White" 
                        DocumentLanguage="Custom" 
                        FontFamily="Verdana" 
                        IsReadOnly="True" 
                        Text="{Binding SelectedModel.ResourceJson, Mode=TwoWay}" /> 
                </Grid> 
            </syncfusion:TabItemExt> 
            <syncfusion:TabItemExt Name="tabInbound" Header="XML"> 
                <Grid> 
                    <syncfusion:EditControl 
                        Name="editXML" 
                        Background="White" 
                        DocumentLanguage="XML" 
                        FontFamily="Verdana" 
                        IsReadOnly="True" 
                        Text="{Binding SelectedModel.ResourceXml, Mode=TwoWay}" /> 
                </Grid> 
            </syncfusion:TabItemExt> 
        </syncfusion:TabControlExt> 
 
We have attached the sample for the same, please download it from below location, 


If we have misunderstood your query, please get back to us with more details. This would help us to provide solution at earliest. 

Regards, 
Durga S. 


Loader.
Up arrow icon