如何使用C#2010在无界数据网格指定列中设置焦点? [英] How to set Focus in Unbounded datagridview specified columns using C# 2010 ?
问题描述
在我的项目中我使用无界数据网格视图使用指定的列,如ID,项目名称,项目代码,大小,颜色,速率,数量,总计。在这里,我让我的最终用户输入项目名称/项目代码和数量。剩余列将自动完成。现在我的问题是当最终用户输入项目名称/项目代码时焦点应设置为数量,当数量为输入时,焦点应该在项目名称/项目代码的新行中。
是否有可能。任何人都可以给我一个权利来完成这项任务......
概念焦点不适用于单元格或控件的其他部分。它总是意味着键盘焦点,并且仅适用于整个控件,在您的情况下,适用于DataGridView
的实例。什么是适用的称为选择,是的,它类似于焦点。所以,请查看MSDN帮助页面:
http ://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.aspx [ ^ ]。
如果你搜索这个带有select键的页面,以及代表单元格,列和行的相关类的页面,您将很容易找到所需内容。
-SA
In My Project I''m Using a Unbounded Datagridview With specified Columns like ID, Item Name, Item Code, Size, Color, Rate, Quantity, Total. Here i made my End User to Enter the Item Name / Item-code and Quantity only. Remaining Columns Will Be auto Completed. Now My Problem is When End User Enter the Item Name/ Item Code the Focus Should set to the quantity and when quantity as enter then the focus should be in new row on Item Name/ Item Code .
is it possible . can anybody give me a right it to achieve this task...
The notion "focus" is not applicable to cells or other parts of a control. It always means "keyboard focus" and only applicable to a whole control, in your case, to the instance ofDataGridView
. What is applicable is called "selection", and yes, it is similar to "focus". So, look at the MSDN help page:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.aspx[^].
If you search through this page with a key "select", as well as the pages for related classes representing cells, columns and rows, you will easily find what you need.
—SA
这篇关于如何使用C#2010在无界数据网格指定列中设置焦点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!