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

RadGridView when exception thrown on cell editing disables keyboard

1 Answer 77 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Karthi
Top achievements
Rank 1
Karthi asked on 18 Nov 2014, 09:26 AM
Hi,

When an exception is throw during cell validation in RadGridView edit mode, disables the keyboard.

I am using Telerik for WPF 2014 - Q2 (Version-2014.2.0729.45).

In the attached sample, click on the first cell (Robert), Click F2 to begin the edit mode.
Try providing a name that is already exists (Eric) and exception will be thrown.
Close the message box and try typing anything in the cell which will not accept any keyboard inputs.

Please let me know if this issue can be fixed.

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 18 Nov 2014, 03:56 PM
Hello,

Thank you for attaching a sample project to illustrate the issue.

I debugged the demo and as it turns out a TargetInvocationException is thrown in your code. Once I commented it committing the edit worked as expected.
void HandleCellValidating(object sender, GridViewCellValidatingEventArgs e)
{
    if (studentList.Any(s => s.FirstName == e.NewValue.ToString()))
    {
        e.Handled = true;
        //throw new Exception();
    }
}

As I understand throwing an Exception is how you validate the user input and the problem is that this disables the keyboard input. I was indeed able to reproduce the exact described issue with our latest version.

Generally, I would suggest you to use our Validating mechanism instead of throwing an exception. How does it work for you? Is there a special reason why do you need raising an Exception specifically?

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Karthi
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or