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

[Solved] Argument Exception when leaving cellEditTemplate

3 Answers 110 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Inquisitor Jax
Top achievements
Rank 1
Inquisitor Jax asked on 09 Sep 2009, 09:56 AM
When I tab out from editing a cell, I get a ArgumentException.
This only occurs if I have CLR exceptions turned on (Ctrl+E shortcut in VS)
ie: Telerik code is swallowing the exception in the callstack = code smell.

I always code with CLR exceptions turned on as it makes debugging a lot easier, and it's quite irritating having to press Continue on the ArgumentException every time I edit a cell.


3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 09 Sep 2009, 11:06 AM
Hi Inquisitor Jax,

Sometimes it is useful to handle the original exception and provide a bit more "human readable". Example for such handling can be Convert.ChangeType().

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Inquisitor Jax
Top achievements
Rank 1
answered on 09 Sep 2009, 11:16 AM
In some exceptional cases, yes.
What I'm really asking, is this:
Can this exception not be avoided within the Telerik codebase?

FYI - here's the call stack:
> System.Windows.dll!MS.Internal.XcpImports.MethodEx(System.IntPtr ptr = 268948472, string name = "GetPosition", MS.Internal.CValue[] cvData = {MS.Internal.CValue[1]}) + 0x1c1 bytes
  System.Windows.dll!MS.Internal.XcpImports.MethodPack(System.IntPtr objectPtr = 268948472, string methodName = "GetPosition", object[] rawData = {object[1]}) + 0xc92 bytes
  System.Windows.dll!MS.Internal.XcpImports.MouseEventArgs_GetPosition(System.Windows.Input.MouseEventArgs args = {System.Windows.Input.MouseButtonEventArgs}, System.Windows.UIElement relativeTo = {Telerik.Windows.Controls.GridView.GridViewRow}) + 0x8a bytes
  System.Windows.dll!System.Windows.Input.MouseEventArgs.GetPosition(System.Windows.UIElement relativeTo = {Telerik.Windows.Controls.GridView.GridViewRow}) + 0x33 bytes
  Telerik.Windows.Data!Telerik.Windows.Controls.RowItemMouseEventArgs.FromMouseEvent(System.Windows.Input.MouseEventArgs args = {System.Windows.Input.MouseButtonEventArgs}, System.Windows.UIElement targetElement = {Telerik.Windows.Controls.GridView.GridViewRow}) + 0x69 bytes
  Telerik.Windows.Data!Telerik.Windows.Controls.RadRowItem.OnMouseLeftButtonDown(System.Windows.Input.MouseButtonEventArgs e = {System.Windows.Input.MouseButtonEventArgs}) + 0x3e bytes
  System.Windows.dll!System.Windows.Controls.Control.OnMouseLeftButtonDown(System.Windows.Controls.Control ctrl = {Telerik.Windows.Controls.GridView.GridViewRow}, System.EventArgs e = {System.Windows.Input.MouseButtonEventArgs}) + 0x58 bytes
  System.Windows.dll!MS.Internal.JoltHelper.FireEvent(System.IntPtr unmanagedObj = 268917920, System.IntPtr unmanagedObjArgs = 268948472, int argsTypeIndex = 169, string eventName = "M@@3") + 0x321 bytes

0
Hristo
Telerik team
answered on 09 Sep 2009, 11:53 AM
Hello Inquisitor Jax,

Indeed we should not even catch exception at this point (e.GetPosition(...)) but this is Silverlight 3 specific issue. Even when the row is not in the visual tree it receive mouse events and calling e.GetPosition throws an exception. We cannot remove this try/catch part until we find some workaround (or Microsoft fix it). I'll research if there is other way to handle this.

Best wishes,
Hristo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Inquisitor Jax
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Inquisitor Jax
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or