This is a migrated thread and some comments may be shown as answers.

Gridview not refreshing data after switch tabs

3 Answers 375 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Hakim
Top achievements
Rank 1
Hakim asked on 26 Sep 2011, 11:45 AM
Hi,

I have some RadTabItem and each one have a gridview which are binded to lists of type ObservableCollections.
Each line of gridviews have on it a GridViewCheckBoxColumn and a GridViewDataColumn  which show when the checkbox was updated for the last time.
The collections contains entities which implement INotifyPropertyChanged.

The issue come when I start the application, I switch to the third tab I check the checkbox on one line and the field of the line is updated.
I switch to another tab and switch back to the third tab, check the checkbox on one line but now the field of the line is not updated.

I thought at the beginning that it was a problem of the entity which not update the data at it should but the entity have always the right values.
I also added a combobox in one tab for testing and binded it to the same collection of the gridview and the combobox show always the correct updated values so the problem seems to come from the gridview.

Here is the gridview of one tab:
<telerik:RadGridView telerik:StyleManager.Theme="Office_Blue"  Width="auto" Height="100" ItemsSource="{Binding MyCollection}" AutoGenerateColumns="False">
    <telerik:RadGridView.Columns>
        <telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding IsDemande, Mode=TwoWay}" />
        <telerik:GridViewDataColumn Width="auto"  DataMemberBinding="{Binding DateLastUpdate}" />
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

And here is the combobox which is binded correctly to the collection:
<ComboBox ItemsSource="{Binding MyCollection}">
<ComboBox.ItemTemplate>
<DataTemplate>
<ComboBoxItem Content="{Binding DateLastUpdate}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>

Did you already experienced this issue?
Thanks

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 28 Sep 2011, 02:51 PM
Hello Hakim,

Indeed you are right that this is some problem with the TabControl and RadGridView. We have a very similar issue logged to our system for fixing and we are currently working on solving it.

We apologize for the inconvenience caused.

Kind regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Dimitrina
Telerik team
answered on 14 Oct 2011, 08:19 AM
Hello Hakim,

 We have investigated the problem that values in grid are not updated when grid is on another tab. We have found that if you set the "IsContentPreserved" property of the RadTabControl to True.

<telerik:RadTabControl IsContentPreserved="True">
            <telerik:RadTabItem Header="Tab One">...GridView...
             </telerik:RadTabItem>  
            <telerik:RadTabItem Header="Tab Two">...
            </telerik:RadTabItem>                       
</telerik:RadTabControl>

Could you please try this in your solution and let me how it works. Best wishes,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Hakim
Top achievements
Rank 1
answered on 14 Oct 2011, 01:29 PM
Hello Didie,

I tried your solution and it works fine!

Thank you
Tags
GridView
Asked by
Hakim
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Hakim
Top achievements
Rank 1
Share this question
or