ASP网格视图示例 [英] Asp Grid View Examples

查看:121
本文介绍了ASP网格视图示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用vs2005和sql server2005.
我的数据库中有两个表,分别是employee和dept
在两个表中,EmplId是公共字段并具有关系
现在,在asp.net中,我显示了两个网格,
1.员工
2.部门
该功能是在第一个网格上单击Emplid
部门表的列应显示在第二个网格中.

当我们单击Emplid in 1st网格时,应显示一条消息,
我们正在选择以下emplId:

接下来,应在编辑和更新后对其进行编辑和更新
显示相应ID已更新的消息.

接下来我们要插入一个按钮,它出现在网格的外侧,即AddNewRecord
当我们单击按钮时,应在第二个网格中插入一行.

我想要说明在哪些事件中我们应该编写代码

谁能帮我吗

在此先谢谢您.我希望它会起作用.



您想在gridview中插入行,然后在Footer中添加文件,如果在插入数据中遇到任何问题,请插入,然后更新,我将向您发送用于插入行的代码.


你好

用这个
功能完备的嵌套数据网格 [可编辑的嵌套数据网格 [ 私有 DataGridView1_CellContentClick( ByVal 发​​件人 As 系统.对象 ByVal e As System.Windows.Forms.DataGridViewCellEventArgs)句柄 DataGridView1.CellContentClick MsgBox(DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value) 结束



获得empID后,您可以从数据库中获取数据并将其添加到其他Grid

谢谢


I''m using vs2005 and sql server 2005.
Im having two tables in my database which were employee and dept
In both the tables EmplId is common field and have relationship
Now, in asp.net im displaying two grids,
1. Employee
2.Dept
The functionality is if we click emplid on first gird
the columns of dept table should be displayed in 2nd grid.

when we click the Emplid in 1st grid it should display a message that
we are selecting the following emplId:

Next in second it should be edit and update after editing and update it should
display message that the respective id has been updated.

Next we have a button to insert,it appears out side the grids, i.e AddNewRecord
when we click the button a row should inserted into 2nd grid.

I want description In which events we should write the code

Could any one please help me

Thanks in Advance.

when you select the empid from the first grid on the base of this empid fliter the data from the second grid on selectedindexchange event of first gridview try this i hope its will work.



you want insert into row in gridview then add filed in Footer and insert if any problem in insert data update me i will send u code for insert row.


hello

use This
Fully functional Nested DataGrid[^]

or
Editable Nested DataGrid[^]

thanks

Sanjeev


You can get the Employee Id by using this code

Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
    MsgBox(DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value)
End Sub



After getting your empID you can get the data from database and add it to other Grid

Thanks


这篇关于ASP网格视图示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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