The scenario:
We have a xamwebgrid with several template columns. Most of the template columns have text boxes in them, in both the item and edit templates.
When clicking between the columns, all seems well most of the time. However, it looks as if I inadvertently perform a drag of some kind while switching columns with the mouse, I get the following error:
Value does not fall within the expected range.
at MS.Internal.XcpImports.CheckHResult(UInt32 hr) at MS.Internal.XcpImports.Control_Raise(Control control, INativeCoreTypeWrapper arguments, Byte nDelegate) at System.Windows.Controls.Control.NativeMouseMove(MouseEventArgs e) at System.Windows.Controls.TextBox.OnMouseMove(MouseEventArgs e) at System.Windows.Controls.Control.OnMouseMove(Control ctrl, EventArgs e) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
There are no data or validation issues here, this seems to be totally a "behind the scenes" problem for us.
I have no idea how to even troubleshoot this problem, and putting together a repro sample may be challenging.
Any ideas?
-Chuck
Hey Chuck,
Ok, that was a tough one to narrow down, but I figured out what the problem is and the fixed the issue, so it'll be in the next Service Release.
So, whats happening is this. DoubleClick on your TextBox to enter edit mode, the trick is not to let the mouse button up. Now, while the mouse button is still down, move the mouse...Boom, exception.
The stacktrace shows that something is happening with the TextBox's MouseMove event. At first i thought it was the editor textbox that was throwing th exception, however, it's actually the display textbox. MS is capturing the mouse when a mouse down occurs in the textbox, and listens to mouse move, until mouse up. However, we're entering edit mode in between there and removing the textbox from the visual tree. Since they have the mouse captured, the events still fire on that textbox, and the exception occurs.
So, until the ServiceRelease, you have a couple of options.
1. Don't use a TextBox as your display element, especially since you're allowing an edit mode option. Instead use a TextBlock.
2. Change your EditMode actions from double click to single click.
Hope this helps,
-SteveZ
Hi Steve,
Here is the EditingSettings from my grid:
<igGrid:EditingSettings AllowEditing="Cell" IsMouseActionEditingEnabled="SingleClick" ...
Is this what you mean?
If so, then my only current option would be the text block apparently. LMK.
Thank you all. The workaround of using TextBlocks for the ItemTemplate seems to have solved the problem.
Check out this page for info on service release dates: http://es.infragistics.com/support/default.aspx#ServiceReleases
Devin
Hi,
When do you think you will have the ServiceRelease available?