This is a migrated thread and some comments may be shown as answers.

Problem selecting text when using FilteringMode="FilterRow"

2 Answers 16 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 26 May 2016, 03:31 PM

Launch the Telerik WPF Demos, and go to the "Filtering Configuration" demo.

Change the FilteringMode to FilterRow

Type some text in one of the filter textboxes

Using your mouse, attempt to click and drag to highlight this text.

The column reordering mechanism of the grid kicks in, instead of highlighting the text as would be expected.

 

Is there any way to change this behaviour?

 

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 27 May 2016, 10:55 AM
Hello Steve,

The issue you have reported is known to us and we are currently working on a fix. In the meantime, you can make use of the following workaround (assuming your RadGridView has a Name equal to clubsGrid):

public MainWindow()
{
    InitializeComponent();
    this.clubsGrid.FieldFilterEditorCreated += clubsGrid_FieldFilterEditorCreated;
}
  
private void clubsGrid_FieldFilterEditorCreated(object sender, Telerik.Windows.Controls.GridView.EditorCreatedEventArgs e)
{
    e.Editor.AddHandler(FrameworkElement.MouseEnterEvent, new MouseEventHandler(OnMouseEnter), true);
    e.Editor.AddHandler(FrameworkElement.MouseLeaveEvent, new MouseEventHandler(OnMouseLeave), true);
}
  
private void OnMouseLeave(object sender, MouseEventArgs e)
{
    var parentHeaderCell = (sender as FrameworkElement).ParentOfType<GridViewHeaderCell>();
    if (parentHeaderCell != null)
    {
        DragDropManager.SetAllowDrag(parentHeaderCell, true);
    }
}
  
private void OnMouseEnter(object sender, MouseEventArgs e)
{
    var parentHeaderCell = (sender as FrameworkElement).ParentOfType<GridViewHeaderCell>();
    if (parentHeaderCell != null)
    {
        DragDropManager.SetAllowDrag(parentHeaderCell, false);
    }
}

I hope you find this helpful.

Regards,
Dilyan Traykov
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Steve
Top achievements
Rank 1
answered on 01 Jun 2016, 04:22 PM
Thanks Dilyan, that works perfectly!
Tags
GridView
Asked by
Steve
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Steve
Top achievements
Rank 1
Share this question
or