str = this.dataGridView1.CurrentCell.Value.ToString();
int a = this.dataGridView1.CurrentCell.RowIndex;
str+="."+this.dataGridView1.Rows[a].Cells[0].Value.ToString();
我的想法是,点下DATAGRIDVIEW里面的单元格,就在LABEL里面显示这条记录相关数据库里面的的上条记录,上上条记录和下条记,下下条记录,下下下条记录。呵呵。请问如何实现呢!?
int a = this.dataGridView1.CurrentCell.RowIndex;
str+="."+this.dataGridView1.Rows[a].Cells[0].Value.ToString();
我的想法是,点下DATAGRIDVIEW里面的单元格,就在LABEL里面显示这条记录相关数据库里面的的上条记录,上上条记录和下条记,下下条记录,下下下条记录。呵呵。请问如何实现呢!?
取到当前点坐标,就是第几行,第几列,直接加就可以了.items都可以取出来的啊.呵.
好像SQL就可以办到,可惜没学好,不知道怎么写才好了。
在你填充datagrid的时候就是按照sql查询出来的顺序填充的,所以datagrid的上一行就是上一条记录
(select top 2 × from table where id<取得的id order by id desc) union (select top 3 * from table where id>取得的id)