<telerik:RadGridView x:Name="RadGridView1" ItemsSource="{Binding}" Grid.Row="1" GroupPanelForeground="Red" > <telerik:RadGridView.ChildTableDefinitions> <telerik:GridViewTableDefinition> <telerik:GridViewTableDefinition.Relation> <telerik:PropertyRelation ParentPropertyName="Students"/> </telerik:GridViewTableDefinition.Relation> </telerik:GridViewTableDefinition> </telerik:RadGridView.ChildTableDefinitions> </telerik:RadGridView>public partial class MainWindow : Window { ObservableCollection<MyObject> _MyObject = new ObservableCollection<MyObject>(); DataContextDataContext context1 = new DataContextDataContext(); public MainWindow() { InitializeComponent(); DataContext = new ObservableCollection<MyObject>(); RadGridView1.Filtered+=new EventHandler<GridViewFilteredEventArgs>(RadGridView1_Filtered); foreach (var p in context1.Students) { _MyObject.Add(new MyObject { ID = p.StudentID, Name = p.StudentFN }); } } void RadGridView1_Filtered(object sender, GridViewFilteredEventArgs e) { RadGridView1.ItemsSource = _MyObject; } private void Button_Click(object sender, RoutedEventArgs e) { } } public class MyObject { public int ID { get; set; } public string Name { get; set; } }private void filter_EditorCreated(object sender, Telerik.Windows.Controls.Data.DataFilter.EditorCreatedEventArgs e) { DataObject.AddPastingHandler(e.Editor, new DataObjectPastingEventHandler(CheckPasteFormat)); }public void CheckPasteFormat(object sender, DataObjectPastingEventArgs e) { PasteWindow win = new PasteWindow(); win.ShowDialog(); // Modal dialog string result = win.Value.ToString(); DataObject d = new DataObject(); d.SetData(DataFormats.Text, result); e.DataObject = d; } Cannot perform this operation while dispatcher processing is suspended.
I have found a solution to this using Dispather.BeginInvoke but this has another problem with the folowing part updating the DataObject due to it is asynchroniously. There might be solutions to this also, but it gives me a feeling of a lot of hacks to make it work
So my next approach (and maybee more correct solution) would be to define a new "Paste special" command/functionality to handle my special pasting inside editor. Actually kind of the same way as Word, Excell etc does it, Im not very familiar with commands and stuff like that. Can you tell me if it is possible to add/append a "paste special" command with keyboard shortcut to the radDataFilter editors. It should also be available using the right-click menu in the radDataFilter editors.
Hopefully the "Speciel paste" will support undo etc, and clipboard content should not be changed using the "Speciel paste".
Hopefully you will be able to help me with this one.