or
RadGridView1.CurrentCell.Value = "sometext"; <telerik:RadGridView x:Name="RadGridView1" ItemsSource="{Binding Items}" Margin="0" RowIndicatorVisibility="Collapsed" IsReadOnly="True" AutoGenerateColumns="False" CanUserFreezeColumns="False" CanUserResizeColumns="True" MouseDoubleClick="RadGridView1_MouseDoubleClick" IsFilteringAllowed="True"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding BusinessItem.Name}" Width="*" />...
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)); |
| } |
| } |
| } |
| } |
| <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> |

<telerik:RadGridView Name="PeopleGrid" Width="{Binding ElementName=theRootElement, Path=ActualWidth}" ItemsSource="{Binding Source={StaticResource people}, Path=People}" IsReadOnly="True" EditTriggers="None"> <telerik:RadGridView.Columns> <telerik:GridViewToggleRowDetailsColumn ExpandMode="Single" /> <telerik:GridViewDataColumn Header="First Name" DataMemberBinding="{Binding FirstName}" /> <telerik:GridViewDataColumn Header="Last Name" DataMemberBinding="{Binding LastName}" /> <telerik:GridViewDataColumn Header="Age" DataMemberBinding="{Binding Age}" /> <telerik:GridViewDataColumn Header="Marital Status" DataMemberBinding="{Binding MaritalStatus}" /> <telerik:GridViewDataColumn Width="*"> <telerik:GridViewDataColumn.CellStyle> <Style TargetType="telerik:GridViewCell"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> <Button x:Name="btn_EditPerson" ToolTip="Edit"> Edit </Button> <Button ToolTip="Delete" Command="{Binding Source={StaticResource people}, Path=DeletePerson}" CommandParameter="{Binding .}"> Delete </Button> </StackPanel> </ControlTemplate> </Setter.Value> </Setter> </Style> </telerik:GridViewDataColumn.CellStyle> </telerik:GridViewDataColumn> </telerik:RadGridView.Columns> <telerik:RadGridView.RowDetailsTemplate> <DataTemplate> <!-- Additional Controls to Display Additional Info...has no affect on problem if I comment this part out --> </DataTemplate> </telerik:RadGridView.RowDetailsTemplate></telerik:RadGridView>#region private void HandleCheckBoxFilters()private void HandleCheckBoxFilters(){ bool? PaidInFullChecked = CheckBox_PaidInFull.IsChecked; bool? Show60PaymentsOnlyChecked = CheckBox_FixedAmount.IsChecked; //RadGridView_TrusteeLedgers.FilterDescriptors.Clear(); CompositeFilterDescriptor compositeDescriptor = new CompositeFilterDescriptor(); compositeDescriptor.LogicalOperator = FilterCompositionLogicalOperator.And; RadGridView_TrusteeLedgers.FilterDescriptors.Clear(); if (PaidInFullChecked == true) { FilterDescriptor filterDescriptor_PaidInFull = new FilterDescriptor(); filterDescriptor_PaidInFull.Member = "PaidInFull"; filterDescriptor_PaidInFull.Operator = FilterOperator.IsEqualTo; filterDescriptor_PaidInFull.Value = true; filterDescriptor_PaidInFull.IsCaseSensitive = false; compositeDescriptor.FilterDescriptors.Add(filterDescriptor_PaidInFull); } if (Show60PaymentsOnlyChecked == true) { FilterDescriptor filterDescriptor_FixedAmount = new FilterDescriptor(); filterDescriptor_FixedAmount.Member = "TotalRemaining"; filterDescriptor_FixedAmount.Operator = FilterOperator.IsEqualTo; filterDescriptor_FixedAmount.Value = Convert.ToDecimal(60); filterDescriptor_FixedAmount.IsCaseSensitive = false; compositeDescriptor.FilterDescriptors.Add(filterDescriptor_FixedAmount); } RadGridView_TrusteeLedgers.FilterDescriptors.Add(compositeDescriptor);} #endregionHere is my Xaml
<DockPanel Name="DockPanel_Content_CenterDock" HorizontalAlignment="Stretch" Margin="2" Grid.Row="2" Grid.Column="0" > <telerik:RadBusyIndicator x:Name="RadBusyIndicator_TrusteeLedgerContent" BusyContent="Loading data..."> <telerik:RadGridView Name="RadGridView_TrusteeLedgers" DataLoadMode="Asynchronous" IsFilteringAllowed="False" ShowGroupPanel="False" telerikControls:Theming.Theme="Office_Blue" EnableRowVirtualization="True" AutoGenerateColumns="False" SelectionUnit="FullRow" SelectionMode="Single" SelectionChanged="RadGridView_TrusteeLedgers_SelectionChanged"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn Header="Case Number" DataMemberBinding="{Binding CaseNumber}" Width="100" IsReadOnly="True" /> <telerik:GridViewDataColumn Header="Trustee" DataMemberBinding="{Binding TrusteeCode}" Width="75" IsReadOnly="True" /> <telerik:GridViewDataColumn Header="Case Title" DataMemberBinding="{Binding CaseTitle}" Width="200" IsReadOnly="True" /> <telerik:GridViewDataColumn Header="Prev Chapter" DataMemberBinding="{Binding PreviousChapter}" Width="75" IsReadOnly="True" /> <telerik:GridViewDataColumn Header="Chapter" DataMemberBinding="{Binding Chapter}" Width="75" IsReadOnly="True" /> <telerik:GridViewDataColumn Header="Closed" DataMemberBinding="{Binding CaseIsClosed, Converter={StaticResource BooleanToStringConverter}}" Width="75" IsReadOnly="True" /> <telerik:GridViewDataColumn Header="NoticeFiled" DataMemberBinding="{Binding NoticeFiled, Converter={StaticResource BooleanToStringConverter}}" Width="75" IsReadOnly="True"/> <telerik:GridViewDataColumn Header="PaidInFull" DataMemberBinding="{Binding PaidInFull, Converter={StaticResource BooleanToStringConverter}}" Width="75" IsReadOnly="True" /> <telerik:GridViewDataColumn Header="Amount" DataMemberBinding="{Binding TotalRemaining}" DataFormatString="{}{0:c}" Width="75" IsReadOnly="True" /> <telerik:GridViewColumn Header="Voucher" > <telerik:GridViewColumn.CellTemplate> <DataTemplate> <CheckBox IsChecked="{Binding VoucherRequested}" Width="75" /> </DataTemplate> </telerik:GridViewColumn.CellTemplate> </telerik:GridViewColumn> </telerik:RadGridView.Columns> <telerik:RadGridView.SortDescriptors> <telerik:SortDescriptor Member="TransactionDate" SortDirection="Ascending"></telerik:SortDescriptor> </telerik:RadGridView.SortDescriptors> <!--<telerik:RadGridView.GroupDescriptors> <telerik:GroupDescriptor Member="OfficeName" SortDirection="Descending" DisplayContent="Office Name"> <telerik:GroupDescriptor.AggregateFunctions> <telerik:SumFunction Caption="Office Total" SourceField="TotalNonRegistry" ResultFormatString="{}{0:c}"></telerik:SumFunction> </telerik:GroupDescriptor.AggregateFunctions> </telerik:GroupDescriptor> </telerik:RadGridView.GroupDescriptors>--> </telerik:RadGridView> </telerik:RadBusyIndicator></DockPanel>