Ticket Q445730
Visible to All Users

DXGrid no updating rows when ItemSource is XpoDataService

created 12 years ago

Hi,

I have the following DXGrid

XAML
<dxg:GridControl Width="700" Margin="70,10,0,0" x:Name="usersGridControl" ItemsSource="{Binding Path=Data, ElementName=MembershipsWcfInstantSource}" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontFamily="Segoe UI Light"> <dxg:GridControl.Columns> <dxg:GridColumn Name="colUserId" FieldName="UserId" Visible="False" HeaderTemplate="{StaticResource GridHeaderTemplate}" /> <dxg:GridColumn Name="colUserName" FieldName="User.UserName" Header="{Binding emailLabel, Mode=OneWay, Source={StaticResource localizedResx}}" HeaderTemplate="{StaticResource GridHeaderTemplate}"/> <dxg:GridColumn Name="colFirstName" FieldName="UserProfile.FirstName" Header="{Binding lastNameLabel, Mode=OneWay, Source={StaticResource localizedResx}}" HeaderTemplate="{StaticResource GridHeaderTemplate}"/> <dxg:GridColumn Name="colLastName" FieldName="UserProfile.LastName" Header="{Binding firstNameLabel, Mode=OneWay, Source={StaticResource localizedResx}}" HeaderTemplate="{StaticResource GridHeaderTemplate}"/> <dxg:GridColumn Name="colCompany" FieldName="Company.CompanyName" Header="{Binding companyLabel, Mode=OneWay, Source={StaticResource localizedResx}}" HeaderTemplate="{StaticResource GridHeaderTemplate}"/> </dxg:GridControl.Columns> <dxg:GridControl.View> <dxg:TableView x:Name="view" AutoWidth="True" NavigationStyle="Row" AllowGrouping="False" ShowGroupPanel="False" RowMinHeight="36" HeaderPanelMinHeight="36" /> </dxg:GridControl.View> </dxg:GridControl>

and this WCF instant feedback

XAML
<dx:WcfInstantFeedbackDataSource x:Name="MembershipsWcfInstantSource" KeyExpression="UserId" UseExtendedDataQuery="False" />

After editing a data row and commiting the changes to the db, I'm calling all these:

C#
MembershipsWcfInstantSource.Refresh(); usersGridControl.RefreshData(); usersGridControl.RefreshRow(view.FocusedRowHandle);

No matter the order or calling all or any of those, the result is the same the data that is showing in the grid doesn't get updated.
I'm positive the changes are commited to the db and I'm seeing the the new data comming from the service in Fiddler.

Am I doing something wrong or is this a bug?
Thanks

Comments (3)
DevExpress Support Team 12 years ago

    Hi Jose,
    Thank you for your inquiry. I tried to reproduce this issue with the How to implement CRUD operations using DXGrid and WCF Data Services example but without success. As you can see in the attached screencast, cells are updated correctly. We would appreciate it if you provide us with a sample so that we can reproduce this problem.
    Thanks

      Hi Ivan,
      I've managed to find the issue: it was related with the fact the the object was being edited on a separate context. Despite the Refresh() of the InstantSource was being called, and the new data was being received from the database the context was missing the proper MergeOption to accept updates from the data source.

      DevExpress Support Team 12 years ago

        Thank you for informing us that the issue has been resolved. Please do not hesitate to contact us if you have any further difficulty. We will be happy to help you!

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.