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

Application sometimes dos not call RowLoaded

0 Answers 43 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Uwe
Top achievements
Rank 1
Uwe asked on 12 Oct 2012, 04:19 PM
Hello Telerik
I have a WPF application with UserControls. One UserControl contains a RdGridView (DataView/DataViewModel). The application can switch between some several UserControls
like this:

xaml:

<Window.Resources>
    <DataTemplate DataType="{x:Type local.viewmodels:WellcomeViewModel}">
        <local.views:WellcomeView />
    </DataTemplate>
    <DataTemplate DataType="{x:Type local.viewmodels:DataViewModel}">
        <local.views:CurrentDataView />
    </DataTemplate>
    
</Window.Resources>

 MainWindowViewModel C#:

CurrentPageViewModel = PageViewModels.Find(vm => vm.ToString() == "WPFPageApp.ViewModels.CurrentDataViewModel");

The RadGridView is bound to a QueryableEntityCollectionView property  (Suppliersof the DataViewModel using the EntityFramework. 
On one button in the MainWindowViewMode I set a Filter before switching to the DataView via MVVM Light messaging in the DataViewModel:

DateTime toDay = DateTime.Now.Date;
Suppliers.FilterDescriptors.Add(new FilterDescriptor("InsertDate", FilterOperator.IsGreaterThanOrEqualTo, toDay));

On another button (in the MainWindowViewMode ) I change the sort order before switching to the DataView:

Suppliers.SortDescriptors.Add(new SortDescriptor()
{
    Member = "Id",
    SortDirection = System.ComponentModel.ListSortDirection.Descending
});

With EventToCommand from MVVM Light I call a function RowLoaded in the DataViewModel to format the cells. 
So far so good.
The problem is that sometimes the RowLoaded even is not called, when I switch from one UserControl to the UserControl containing the RadGridView. It seems that something happened to the GridView when the UserControl is switching to another UserControl.

I hope I have explained it well enough to understand the architecture.

Thank you in advance Uwe

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Uwe
Top achievements
Rank 1
Share this question
or