Home All Groups Group Topic Archive Search About

Backslash in datagrid not working

Author
23 Nov 2004 7:24 AM
Bj?rn Jansson
Hi,
I have a databound datagrid. It is bound to an array of custom
objects. The object contains a string Property that is editable in the
datagrid.
It works fine for any charachters, except the backslash character
('\'). When I enter a backslash it seems as if the editbox looses
focus. If I continue to write characters they doesn't show up until I
click another cell and then the original data is gone and only the
text I wrote after the backslash is left.

I've searched for this problem on the net but can't find anything
about it. Does the datagrid behave this way for any of you?

I'm using C# and .Net 1.1

Best regards
Björn Jansson

(this thread is moved from microsoft.public.dotnet.framework.windowsforms.controls)

Author
29 Nov 2004 11:41 AM
Dmitriy Lapshin [C# / .NET MVP]
Hi,

I've had a similar problem with the NumPad + key - it is treated as a
control keystroke (which expands/collapses child rows) even in the edit
mode.
I managed to fix it by overriding the ProcessCmdKey method and adding
handling for the WM_KEYDOWN event and also by overriding ProcessKeyPreview
and ProcessDialogKey and blocking default handling for this key.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

Show quote
"Bj?rn Jansson" <bjans***@passagen.se> wrote in message
news:bc454614.0411222324.53993b52@posting.google.com...
> Hi,
> I have a databound datagrid. It is bound to an array of custom
> objects. The object contains a string Property that is editable in the
> datagrid.
> It works fine for any charachters, except the backslash character
> ('\'). When I enter a backslash it seems as if the editbox looses
> focus. If I continue to write characters they doesn't show up until I
> click another cell and then the original data is gone and only the
> text I wrote after the backslash is left.
>
> I've searched for this problem on the net but can't find anything
> about it. Does the datagrid behave this way for any of you?
>
> I'm using C# and .Net 1.1
>
> Best regards
> Björn Jansson
>
> (this thread is moved from
> microsoft.public.dotnet.framework.windowsforms.controls)

AddThis Social Bookmark Button