数据网格验证问题 [英] datagrid verification issue

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

问题描述

我正在尝试验证一个数据网格,其中任何新行的两个

列中都必须有一个条目,并且这些值必须大于

对应的上一行中的值。通过为该单元格中的底层

文本框调用验证事件来验证用户启动的单元格是非常简单的,但我想要做的是将焦点更改为

新行中的另一列(如果尚未填写)。如果在

处理第一列的验证事件,则包括e.cancel = true

我将回到新行中的那一列,但如果在执行

之前或之后我将当前单元格更改为另一列,我就不会回来如果我没有包括e.cancel,那么,当用户进入时,重点是

触发验证事件。任何想法如何验证一个单元格我可以让用户回到数据网格中的另一个单元格?非常感谢。

I am trying to verify a datagrid in which there must be an entry in both
columns of any new row, and those values must be greater than the
corresponding values in the previous row. It is pretty simple to verify the
cell the user starts in by invoking a verifying event for the underlying
textbox in that cell, but what I would like to do is to change the focus to
the other column in the new row if it has not been filled in. If in
handling the verifying event for the first column I include e.cancel = true
I will come back to that column in the new row, but if before or after doing
that I change the currentcell to the other column, I don''t come back. If I
don''t include e.cancel, of course, the focus goes whereever the user went in
triggering the verifying event. Any ideas re how in verifying one cell I
can get the user back to another cell in the datagrid? Many thanks.

推荐答案

嗨杰克,


目前我正在寻找可以帮助你的人它。我们将在这里回复

,并尽快提供更多信息。

如果您对此有任何疑问,请随时在此处发布。

感谢您的理解!


祝你好运,

Gary Chang

Microsoft在线合作伙伴支持/>

安全! - www.microsoft.com/security

此帖子原样是按原样提供的。没有保证,也没有赋予任何权利。

--------------------

Hi Jack,

Currently I am looking for somebody who could help you on it. We will reply
here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.
Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------


你好杰克,


目前我正在寻找可以帮助你的人。我们将在这里回复

,并尽快提供更多信息。

如果您对此有任何疑问,请随时在此处发布。

感谢您的理解!


祝你好运,

Gary Chang

Microsoft在线合作伙伴支持/>

安全! - www.microsoft.com/security

此帖子原样是按原样提供的。没有保证,也没有赋予任何权利。

--------------------

Hi Jack,

Currently I am looking for somebody who could help you on it. We will reply
here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.
Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------


您好,


感谢您的帖子。据我了解,您面临的问题是,在DataGrid控件的

验证事件中调用e.cancel = true时,您无法将当前单元格设置为其他单元格。如果有任何误解,请纠正我。


1.我在WinForm应用程序中测试了以下代码,但是,我不是

能够重现问题。也就是说,它可以转到

数据网格中的另一个单元格。

private void dataGrid1_Validating(对象发送方,

系统。 ComponentModel.CancelEventArgs e)

{

e.Cancel = true;

dataGrid1.CurrentCell = new DataGridCell(3,3);

}


2.我认为在继续前进之前需要更多信息:

你的应用程序的类型是什么,WinFor或者WebForm?

你能在一个简单的项目中重现这个问题吗?

你能发布一些代码片段还是告诉我重现的详细步骤

问题?


我期待着您的回复。


问候,


HuangTM

微软在线合作伙伴支持

MCSE / MCSD


安全! - www.microsoft.com/security

发布是按原样提供的。没有保证,也没有赋予任何权利。

Hello,

Thanks for your post. As I understand, the problem you are facing is that
you cannot set current cell to other when calling e.cancel = true in the
Validating event of your DataGrid control. Please correct me if there is
any misunderstanding.

1. I tested the following code in my WinForm application, however, I am not
able to reproduce the problem. That is, it can go to another cell in the
datagrid.

private void dataGrid1_Validating(object sender,
System.ComponentModel.CancelEventArgs e)
{
e.Cancel= true;
dataGrid1.CurrentCell = new DataGridCell(3,3);
}

2. I think more information is needed before moving forward:
What''s the type of your application, WinFor or WebForm?
Are you able to reproduce the problem in a simple project?
Could you post some code snippet or tell me the detailed steps to reproduce
the problem?

I look forward to hearing from you.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


这篇关于数据网格验证问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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