编辑datagridview单元格时查看编辑光标 [英] View edit cursor when edit datagridview cell

查看:158
本文介绍了编辑datagridview单元格时查看编辑光标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在制作TPV程序,希望用户直接在DataGridView控件中输入票证.

我的问题是两个:
-如何在不选择单元格的情况下放置和查看编辑光标,当显示datagridview时,我看到选择了第一个单元格(0,0)而没有看到编辑光标,我想查看未选中的内容,并且不单击即可查看编辑光标单元格.

-如何避免在用户完成输入前一行之前创建新行,当用户进行一次按键编辑单元格时,它会自动创建另一行,我不希望在引入所有行数据之前创建该行

注意:对不起,我的英语不好,谢谢.

Hello, I''m making a TPV program, and I whish the user enter tickets directly in a DataGridView control.

My questions are two:
- How to put and view the edit cursor without select the cell, when show datagridview I see first cell (0,0) selected and don''t see the edit cursor, I want to see not selected and view de edit cursor without clicking cell.

- How to avoid new row to be created until the user finish enter the previous row, when the user make one keystroke to edit cell automatically creates another row, I don''t want this row to be created until all row data was introduced

NOTE: Sorry by my poor english, THANKS

推荐答案

如果您需要对DataGridView进行任何操作,则应保留DataGridView常见问题解答(* .doc格式) [(*.pdf格式) [
If you need to do anything with the DataGridView then you should keep a copy of the DataGridView FAQ (*.doc format)[^], (*.pdf format)[^] handy.

In there you will find a solution to your first problem.
myDataGridView.CurrentCell = myDataGridView.Rows[x].Cells[y];
myDataGridView.BeginEdit();


BeginEdit()的MSDN页面 [ ^ ].

对于您的第二个问题,我没有解决方案.我认为这是不可能的,尽管其他人可能知道一种方法.


MSDN page for BeginEdit()[^].

I do not have a solution for your second problem. I do not think that it is possible although someone else might know a way.


这篇关于编辑datagridview单元格时查看编辑光标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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