We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

SfDataGrid Binding not Updating Within Unactivated TabItems

Thread ID:

Created:

Updated:

Platform:

Replies:

119872 Aug 9,2015 10:06 PM Aug 12,2015 11:51 PM WPF 3
loading
Tags: SfDataGrid
Peter Aldersley
Asked On August 9, 2015 10:06 PM

Hi,

The SfDataGrid doesn't update it's binding to a DataView filter change if it is on a TabItem that has not been activated since the window has opened.

I have a TabControl with multiple TabItems. Each TabItem contains a SfDataGrid with it's ItemsSource set to a DataView (One DataView for each SfDataGrid). The problem occurs when the window is opened and the DataView filter for the "hidden" SfDataGrids is changed before the TabItem is activated. Once the TabItem has been activated, then the SfDataGrid updates correctly when the DataView filter is changed (even the "hidden" ones).

Please see the attached project. Run the project and click on the filter button and then the "Grid2" tab to show it hasn't been updated (it should contain the same numbers as Grid1). If you run the project again and select the "Grid2" tab and then the "Grid1" tab before clicking the filter button you will see that Grid2 has been updated correctly.

Thanks.


Attachment: TestWPF_c2c37b3b.zip

Ganeshkumar Lingappan [Syncfusion]
Replied On August 10, 2015 11:43 PM

Hi Peter,

Thank you for Contacting Syncfusion Support

We have analyzed your query and while changing the tab, RowFilter will be cleared when loading the SfDataGrid.  Hence you can skip this by overriding the ResetFilter method in GridDataTableCollectionViewWrapper class. Here we have modified the sample attached in the below mentioned location. Please refer the sample and the below Code-Snippet

Code-Snippet:

Public Class GridDataTableCollectionViewExt   

    Inherits Syncfusion.UI.Xaml.Grid.GridDataTableCollectionViewWrapper

    Public Sub New(source As IEnumerable, grid As SfDataGrid)

        MyBase.New(source, grid)

        DataGrid = grid

    End Sub

    Protected Overrides Sub ResetFilter()       

    End Sub
End Class



Sample Location :
TestWPF


Regards,
Ganeshkumar


Peter Aldersley
Replied On August 11, 2015 12:29 AM

Many thanks Ganeshkumar... that works a treat!

Peter

Ashok N [Syncfusion]
Replied On August 12, 2015 11:51 PM

Hi Peter

Thank you for your update. Please let us know if you require further assistance on this.

Thanks,
Ashok


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;