嗨,朋友们,如何在Windows窗体中同时使用数据网格视图的行和按钮 [英] Hi friends , how to use row of a data grid view and a button simultaniously in windows forms

查看:93
本文介绍了嗨,朋友们,如何在Windows窗体中同时使用数据网格视图的行和按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友
我有一个带有网格视图的表单,并且有一个名为的插入,更新和删除按钮.该项目还包含3种形式,名称分别为frmInsertData,frmUpdateData,frmDeleteData和与数据库(SQL Server)表列相同的保存按钮和文本框. 现在,我在show frmShowdata的datagridview中显示了该表.
每当我单击插入按钮时,frmInsert窗口就会弹出.
(更新,也要这样删除)
现在我的要求是-当我在网格视图中选择表格的一行时,并且我单击更新"或删除"按钮,应该分别用数据填充frmUpdate或frmDelete 的行.
(该应用程序在3tire中,它是Windows)

hi friends
I have a form with a grid view and insert,update and delete buttons called . And that project also consists of 3 more forms with names frmInsertData,frmUpdateData, frmDeleteData consists of a save button and text boxes which are same as columns of a table of the database(Sql Server).
now I displayed the table in the datagridview of show frmShowdata.
when ever I click on insert button frmInsert window will get pop up.
(update,delete also like that)
now my requirement is - when ever I select one row of table in the grid view and I click on update or delete button,frmUpdate or frmDelete should be populated respectively with the data of the row.
(the application is in 3tire and it is windows)

推荐答案



如果是上述情况,则可以按照下面的波纹管示例中的示例实现此目标:

http: //weblogs.asp.net/gurusarkar/archive/2010/04/28/binding-list-of-custom-class-to-gridview-or-listview-control.aspx [
Hi,

If above is the case then you can achieve it as shown in the example in the bellow link:

http://weblogs.asp.net/gurusarkar/archive/2010/04/28/binding-list-of-custom-class-to-gridview-or-listview-control.aspx[^]

As you are already using 3 tire You need to pass the object of selected row in datagridview in the form and rest can be handled in the respective forms.

Regards,
Darshan.


这篇关于嗨,朋友们,如何在Windows窗体中同时使用数据网格视图的行和按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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