DataGrid ComboBox [英] DataGrid ComboBox

查看:59
本文介绍了DataGrid ComboBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我仍然遇到使用

DataGridComboBox列在DataGrid中进行Tab键的问题。


我需要允许用户键入值因此,ComboBox因此将其ComboBoxStyle设置为DropDown。这导致Tabbing无法正常工作
。即使我正在使用Windows消息WM_KEYUP,它仍然会通过ComboBox列标记到下一列。


我发现如果我不给键盘焦点即注释

ColumnComboBox.Focus Tabbing工作正常,但ComboBox没有。


我试图延迟发送WM_SETFOCUS消息但那也没有工作




任何人都可以想到一个解决方法,这个甚至是另一种方式给予

用户类似的功能。他们想要使用

键盘键入值,但值已修复,所以我一直在使用验证事件

来确保它们是Combos列表中的值。它帮助他们

看到Combos DropDown中的值。


任何想法都赞赏。


Doug

Hi I am still having problems with Tabbing through a DataGrid with a
DataGridComboBox Column.

I need to allow the User to Type the value into the ComboBox so consequently
its ComboBoxStyle is set to DropDown. This causes the Tabbing to work
incorrectly. Even though I am consuming the Windows Message WM_KEYUP, it
still Tabs through the ComboBox Column on to the next Column.

I found if I do not give the keyboard focus ie remark out
ColumnComboBox.Focus the Tabbing works correctly but the ComboBox doesn''t.

I tried delaying the sending of the WM_SETFOCUS Message but that didn''t work
either.

Can anyone think of a workaround for this or even another way to give the
user similar Functionality. They want to type the value in using the
keyboard but the values are fixed so I have been using the Validating Event
to ensure that they are values from the Combos list. And it helps them to
see the values as in the Combos DropDown.

Any thoughts appreciated.

Doug

推荐答案

尝试使用PreProcessMessage来忽略KEYUP而不是WndProc。


Public Overrides Function PreProcessMessage( ByRef msg As

System.Windows.Forms.Message)As Boolean

如果msg.Msg = WM_KEYUP那么

返回True

结束如果

返回MyBase.PreProcessMessage(msg)

结束功能


======= ============

Clay Burch

Syncfusion,Inc。

Try using PreProcessMessage to ignore the KEYUP instead of WndProc.

Public Overrides Function PreProcessMessage(ByRef msg As
System.Windows.Forms.Message) As Boolean
If msg.Msg = WM_KEYUP Then
Return True
End If
Return MyBase.PreProcessMessage(msg)
End Function

===================
Clay Burch
Syncfusion, Inc.


Clay,

再次感谢您的意见。


使用PreProcessMessage我是否必须派生我的DataGrid?


Doug


" ClayB" < cl *** @ syncfusion.comwrote in message

news:11 ********************** @ d57g2000hsg.googlegr oups .com ...
Clay,
Again thanks for your input.

To use "PreProcessMessage" will I have to derive my DataGrid?

Doug

"ClayB" <cl***@syncfusion.comwrote in message
news:11**********************@d57g2000hsg.googlegr oups.com...

尝试使用PreProcessMessage忽略KEYUP而不是WndProc。


Public Overrides Function PreProcessMessage(ByRef msg为

System.Windows.Forms.Message)作为布尔值

如果msg.Msg = WM_KEYUP那么

返回True

结束如果

返回MyBase.PreProcessMessage(msg)

结束功能


======== ===========

Clay Burch

Syncfusion,Inc。
Try using PreProcessMessage to ignore the KEYUP instead of WndProc.

Public Overrides Function PreProcessMessage(ByRef msg As
System.Windows.Forms.Message) As Boolean
If msg.Msg = WM_KEYUP Then
Return True
End If
Return MyBase.PreProcessMessage(msg)
End Function

===================
Clay Burch
Syncfusion, Inc.



我收到错误

"''函数PreProcessMessage''无法声明''覆盖'',因为它没有覆盖函数
在基类


我错过了什么吗?


道格
I get an Error
"''Function PreProcessMessage'' can not be declared ''Overrides'' because it
does not override a function in the base class"

Am I missing something?

Doug


这篇关于DataGrid ComboBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆