嗨,朋友们,如何在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.