在C#中选择特殊的行和列 [英] select special row and column in c#

查看:70
本文介绍了在C#中选择特殊的行和列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含GoodsID和GoodsName的表.在我的表格中,我有一个texbox.当我输入GoodID时,它将显示GoodsName.但是想像一下我们是否不知道我们的GoodsID.所以我做了一个搜索按钮.当我单击此按钮时,它将显示一个新表单,以便我可以通过键入GoodsName来搜索GoodsID.现在的问题是,当我找到我要使用的GoodsID时,如何通过单击该单元格来显示此GoodsID.
任何帮助将不胜感激.
在此先感谢

I have a table which has GoodsID and GoodsName. in my form i have a texbox. when i enter the GoodID it will show the GoodsName. but imagine if we don''t know our GoodsID. so i made a search button. when i click on this button it will show a new form so that i can search GoodsID by typing GoodsName. now the question is when i find my intention GoodsID how can i show this GoodsID by clicking on the cell.
any help will be appreciated.
thanks in advance

推荐答案

如果您有从旧版本到新表格的链接,请在关闭旧表格时更新第一个表格.否则,您可以使用调解器模式传递选定的值.

有关介体模式的说明,请参见以下内容.
http://en.wikipedia.org/wiki/Mediator_pattern [
If you have a link to the new form from the old just update first form when you close the old form. Else you can pass the selected value with the mediator pattern.

see following for explanation of the mediator pattern.
http://en.wikipedia.org/wiki/Mediator_pattern[^]


如果您指的是DataGridView,则当单击DataGridview 中的Cell ,然后在此处解释DataGridView CellClick事件
DataGridView.CellClick事件 [
If you are referring to the DataGridView to show GoodsId when a Cell of DataGridview is clicked then CellClick event of DataGridView expalined here
DataGridView.CellClick Event[^]
can be used for this purpose.


这篇关于在C#中选择特殊的行和列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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