Hello Telerik,
I am having a very strange issue when clicking on a row of a grouped grid populated by a VirtualQueryableCollectionView object
It turns out it duplicates itself.
I simulated it in the most simple solution I could think of. Check the attached pictures.
Please heIp me find a workaround for this issue.
The database I used contains only one table, having 4 rows on it.
And here is my code:
MainWindow.xaml
<
Window
x:Class
=
"GroupingRowClickIssue.MainWindow"
xmlns:local
=
"clr-namespace:GroupingRowClickIssue"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
Loaded
=
"Window_Loaded"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
Grid
>
<
telerik:RadGridView
Name
=
"RadGridView"
ItemsSource
=
"{Binding View}"
AutoGenerateColumns
=
"False"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Name}"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Type}"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
Grid
>
</
Window
>
MainWindow.xaml.cs
using
System.Windows;
using
TelerikVirtualization;
namespace
GroupingRowClickIssue
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public
partial
class
MainWindow : Window
{
public
MainWindow()
{
InitializeComponent();
DataContext =
new
ViewModel();
}
private
void
Window_Loaded(
object
sender, RoutedEventArgs e)
{
((ViewModel)DataContext).Load();
}
}
}
ViewModel.cs
using
PropertyChanged;
using
Telerik.Windows.Data;
namespace
TelerikVirtualization
{
[ImplementPropertyChanged]
public
class
ViewModel
{
public
VirtualQueryableCollectionView View {
get
;
set
; }
Controller controller;
public
ViewModel()
{
controller =
new
Controller();
}
public
void
Load()
{
View = controller.GetUsers();
}
}
}
Controller.cs
using
GroupingRowClickIssue;
using
System.Data;
using
System.Linq;
using
Telerik.Windows.Data;
namespace
TelerikVirtualization
{
public
class
Controller
{
public
VirtualQueryableCollectionView GetUsers()
{
DataClasses1DataContext db =
new
DataClasses1DataContext(
"Application Name=test;Data Source=WS-VRC;Initial Catalog=SimpleDB;User ID=sa;Password=App12345"
);
var data = from item
in
db.SimpleTables
select
new
User
{
Name = item.Name,
Type = item.Type
};
VirtualQueryableCollectionView view =
new
VirtualQueryableCollectionView(data) { LoadSize = 30, VirtualItemCount = data.Count() };
return
view;
}
}
public
class
User
{
public
string
Name {
get
;
set
; }
public
string
Type {
get
;
set
; }
}
}