Gridview行编辑和数据集 [英] Gridview Row Editing and Dataset

查看:75
本文介绍了Gridview行编辑和数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨...
我正在使用Gridview1和字段Code,Name和Amount以及复选框字段.我正在将Gridview1与数据库绑定...现在我将gridview的选定复选框行传递给另一个Gridview2. 但是现在我想编辑gridview中的Amount字段,但是我不想更新数据库...只是waana将具有已编辑值的选定行传递到Gridview2,然后将Gridview 2的所有行保存到数据库中.
如何在Gridview1中编辑值而不编辑数据库....然后传递给Gridview2.

请帮我...

解决方案

如何在Gridview1中编辑值而不编辑数据库" ...
数据库更新仅在您触发更新时才会发生.它不会自动更新.别把那个触发器简单了!

有两个gridviews.在第一个进行更改,然后将更改传递给第二个.完成第二个gridview后,根据需要在数据库中激发一个带有gridview 2值的更新语句.数据库更改:

0)从数据库中检索数据
1)将数据表本地存储在Cache或ViewState中的内存中(我认为如果使用Session会产生大数据问题,也可以忘记它)
2)不要将您的GridView1独断地绑定到数据库,请使用本地数据表.
3)根据需要进行更改.
4)将其传递给GV2
5)更新您的数据库.我无法更改Checkbox选定事件的Gridview单元格值.


Hi...
I am using Gridview1 with fields Code,Name and Amount and checkbox field. I am binding Gridview1 with database...Now i am passing selected checkbox rows of gridview to another Gridview2.This works fine.
But now i want to edit the Amount field in gridview but i don''t want to update Database...just waana pass selected rows with edited values to Gridview2, and then save all rows of Gridview 2 to database.
how to edit values in Gridview1 without editing database....and then pass to Gridview2.

Plzz help me...

解决方案

"how to edit values in Gridview1 without editing database"...
Database update will only happen when you trigger an update. It won''t update automatically. Don''t put that trigger, simple!

Have two gridviews. Make a change in first one and pass on the changes to second one. Once you are done with second gridview, fire an update statement in database with the values of gridview two as desired.


maybe you can use a local datatable for manipulating locally your data in GridView1 without any change in database :

0) retrieve data from database
1) store datatable locally in memory in Cache or ViewState (I think if you use Session can create problem with large data, also you can forget it)
2) don''t bind autocratically your GridView1 to database, use local datatable.
3) make change as you like.
4) pass it to GV2
5) update you DB.


Can you please send me the Code.I am kindly new at this. I am not able to change the Gridview cell values on Checkbox selected event.


这篇关于Gridview行编辑和数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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