<Style TargetType="{x:Type telerik:DragVisual}">
but DragVisual is defined in both Telerik.Windows.Controls and Telerik.Windows.DragDrop. Which one should I use?
Hello,
i am using a Gridview that is having a RadObservableCollection<T> (where T is DependencyObject, INotifyPropertyChanged) as ItemsSource. The same collection is also used in a Chartview as Datasource for a Lineseries.
Any changes in the Chart (Drag&Drop) are reflected in the Gridview and the other direction works too.
My problem is the way the editing is passed on:
I have a Double Column which is editable and reflect the values that are shown in the Chart too. But the editing changes are passed on the the chart on every keypress during the editing which is very irritating.
So lets say someone wants to enter 749 as new value the behavior is now like this:
what i want is this:
I guess I need to block some notification sending in the BeginningEdit event and pass out the final new value only in the CellEditEnded event. But i havent been able to work out how.
Thanks in advance!
Mikk
<Window x:Class="DelayedBinding.MainWindow" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Title="MainWindow" Height="350" Width="525"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="*"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <telerik:RadGridView Grid.Row="0" x:Name="radGridView" AutoGenerateColumns="False" ItemsSource="{Binding Path=Items}" IsFilteringAllowed="False" ShowGroupPanel="False" CanUserSortColumns="False"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn Header="Name" Width="65" DataMemberBinding="{Binding Path=Name}"/> <telerik:GridViewDataColumn IsVisible="{Binding Path=ShowNumber}" Header="Number" Width="65" x:Name="NumberColumn" DataMemberBinding="{Binding Path=Number}"/> <telerik:GridViewDataColumn Header="Group" Width="65" DataMemberBinding="{Binding Path=Group}"/> </telerik:RadGridView.Columns> </telerik:RadGridView> <StackPanel Grid.Row="1" Orientation="Horizontal"> <Button Click="ConnectVM" Content="ConnectVM" Margin="5"/> <CheckBox IsChecked="{Binding Path=ShowNumber}" Content="Show Number" VerticalAlignment="Center"/> </StackPanel> </Grid></Window>using System.Collections.ObjectModel;using System.ComponentModel;using System.Windows;namespace DelayedBinding{ public class Item { public string Name { get; set; } public int Number { get; set; } public string Group { get; set; } } public partial class MainWindow : Window, INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; public ObservableCollection<Item> Items { get; private set; } private bool _ShowNumber = false; public bool ShowNumber { get { return _ShowNumber; } set { _ShowNumber = value; if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("ShowNumber")); } } public MainWindow() { Items = new ObservableCollection<Item>(); for (int i = 0; i < 5; i++) Items.Add(new Item() { Name = "Object " + i, Number = i, Group = (i % 2 == 1 ? "Odd" : "Even") }); InitializeComponent(); // If we connect the DataContext here, everything works fine! DataContext = this; } private void ConnectVM(object sender, RoutedEventArgs e) { // If we wait to connect it here, the ShowNumber binding isn't established! DataContext = this; // This is the work-around, by re-establishing the binding, the grid again works correctly. //NumberColumn.SetBinding(Telerik.Windows.Controls.GridViewColumn.IsVisibleProperty, "ShowNumber"); } }}