Hi there,
I am currently evaluating your RadGridView and I must say that I'm quite surprised. Your RadGridView control is easy and straight forward to use compare to other bigger brands in the market. It's very unfortunate that I had wasted several weeks evaluating other grid controls.
I'm currently having a problem with MultipleSelect when it's set to True. Please have a look at the following sample,
XAML code:
<Window x:Class="WpfApplication1.Window1" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
Title="Window1" Height="412" Width="447" |
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" |
xmlns:WpfApplication1="clr-namespace:WpfApplication1"> |
<Window.Resources> |
<ObjectDataProvider x:Key="viewModel" ObjectType="{x:Type WpfApplication1:CustomerViewModel}" /> |
</Window.Resources> |
<Grid> |
<telerik:RadGridView Name="uxdGrid" AutoGenerateColumns="False" |
ItemsSource="{Binding Source={StaticResource viewModel}, Path=CustomersList}"> |
<telerik:RadGridView.Columns> |
<telerik:GridViewDataColumn Width="100" IsReadOnly="False" DataType="{x:Null}" HeaderText="Customer Id" UniqueName="CustomerId" /> |
</telerik:RadGridView.Columns> |
</telerik:RadGridView> |
</Grid> |
</Window> |
Code behind:
using System.Collections.Generic; |
using System.ComponentModel; |
using System.Windows; |
using System.Windows.Data; |
namespace WpfApplication1 |
{ |
/// <summary> |
/// Interaction logic for Window1.xaml |
/// </summary> |
public partial class Window1 : Window |
{ |
public Window1() |
{ |
InitializeComponent(); |
} |
} |
public class CustomerViewModel |
{ |
public CustomerViewModel() |
{ |
List<Customer> customers = new List<Customer>(); |
for (int i = 0; i < 10; i++) |
{ |
Customer customer = new Customer(); |
customer.CustomerId = i; |
customer.CustomerName = string.Format("Name {0}", i); |
customers.Add(customer); |
} |
_view = new ListCollectionView(customers); |
} |
private readonly ListCollectionView _view; |
public ListCollectionView CustomersList |
{ |
get |
{ |
return _view; |
} |
} |
} |
public class Customer : INotifyPropertyChanged |
{ |
private int _customerId; |
private string _customerName = string.Empty; |
public int CustomerId |
{ |
get |
{ |
return _customerId; |
} |
set |
{ |
_customerId = value; |
SendPropertyChanged("CustomerId"); |
} |
} |
public string CustomerName |
{ |
get |
{ |
return _customerName; |
} |
set |
{ |
_customerName = value; |
SendPropertyChanged("CustomerName"); |
} |
} |
private event PropertyChangedEventHandler _propertyChanged; |
public event PropertyChangedEventHandler PropertyChanged |
{ |
add |
{ |
_propertyChanged += value; |
} |
remove |
{ |
_propertyChanged -= value; |
} |
} |
/// <summary> |
/// Raises the property changed event. |
/// </summary> |
/// <param name="propertyName">The property name which value has been changed</param> |
protected void SendPropertyChanged(string propertyName) |
{ |
if (_propertyChanged != null) |
{ |
_propertyChanged(this, new PropertyChangedEventArgs(propertyName)); |
} |
} |
} |
} |
It works as it's expected. But if you set the property MultipleSelect="True",
<Grid> |
<telerik:RadGridView Name="uxdGrid" AutoGenerateColumns="False" MultipleSelect="True" |
ItemsSource="{Binding Source={StaticResource viewModel}, Path=CustomersList}"> |
<telerik:RadGridView.Columns> |
<telerik:GridViewDataColumn Width="100" IsReadOnly="False" DataType="{x:Null}" HeaderText="Customer Id" UniqueName="CustomerId" /> |
</telerik:RadGridView.Columns> |
</telerik:RadGridView> |
</Grid> |
You will notice that the grid is showing the correct number of rows but unfortunately it's not showing any data. Is there anything that I miss here?
Regards,
Hardi