选择下拉列表的值时,不会触发DataTable事件。 [英] DataTable events not getting fired when selecting values for drop down list.

查看:123
本文介绍了选择下拉列表的值时,不会触发DataTable事件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有2个表,第二个表的第一列显示数据验证列表(值来自第一个表)。当我插入一个新行并从下拉列表中选择一个值并按Enter键时,没有任何数据表事件被触发。如果我手动输入值
而不是从下拉列表中选择,那么每件事都可以正常工作并且事件会被触发。


我的Excel项目



复制问题的步骤:


编译并运行上面的项目。


excel打开后,转到 TestSr 制表>点击试用我按钮(新表将创建,其中包含2个表)


选择单元格" E3" 并从下拉列表中选择任意值并按Enter键,注意
TableNewRow 事件未被触发。现在尝试编辑单元格" F3 ",并且也不会触发RowChanged / ColumnChanged事件。(这是问题) 


现在从头开始并再次运行项目并按照相同的步骤,但不是从单元格
" E3" 中的组合框中选择一个值,手动键入一个值并按Enter键,现在注意
TableNewRow 被触发。


BTW,只有当验证列表来自另一个时,才会出现此问题范围。如果选择列表值只是一个逗号分隔值的字符串,那么一切正常。如果需要任何信息,请告诉我。


PS:项目是使用Visual Studio 2012构建和编译的。


谢谢




解决方案

您好
Suresh700,


你提到过,"当我插入一个新行并从下拉列表中选择一个值并按Enter键时,没有任何数据表事件被触发。如果我手动输入值而不是从下拉列表中选择,那么每件事都可以正常运行并且
事件会被触发。"


您是否尝试检查值是否为是否从组合框中正确传递。


如果你没有检查它,那么你可以检查它。


你能做的其他事情是使用组合框用于调用您的数据表事件的事件。


您可以在此处分享您的示例项目,我们将尝试使用它进行测试并尝试重现该问题。


然后我们会尝试为您提供解决问题的进一步建议。


问候


Deepak  


Hi,

I have 2 tables, second table's first column shows data validation list (values are from first table). When I insert a new row and select a value from drop down list and press enter, none of the data table events are being fired. If i enter the value manually instead of selecting from drop down list, every thing works fine and events are getting fired.

My Excel Project

Steps to replicate the issue:

Compile and Run above project.

After excel opens, Go to TestSr tab-> Click on Try Me button (New sheet should get created with 2 tables in it)

Select cell "E3" and choose any value from the drop down list and press enter, notice that TableNewRow event is not fired. Now try to edit cell "F3", RowChanged/ColumnChanged events won't get fired either.(This is the issue

Now start from the scratch and run the project again and follow the same steps, but instead of selecting a value from combo box in cell "E3", manually type in a value and press enter, now notice that TableNewRow gets fired.

BTW, this issue occurs only when validation list is from another range. If the pick list values are just a string with comma seperated values, things works fine. Let me know if any info is needed.

PS: Project was built and compiled using Visual Studio 2012.

Thanks

解决方案

Hi Suresh700,

you had mentioned that,"When I insert a new row and select a value from drop down list and press enter, none of the data table events are being fired. If i enter the value manually instead of selecting from drop down list, every thing works fine and events are getting fired."

did you try to check whether the value is passed correctly from combobox or not.

if you did not check it then you can check it.

other thing you can do is use the combobox events to call your datatable events.

further you can share your sample project here, we will try to make a test with it and try to reproduce the issue.

then we will try to provide you further suggestions to solve the issue.

Regards

Deepak  


这篇关于选择下拉列表的值时,不会触发DataTable事件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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