单击gridview外部的单个按钮,在gridview中保存多行 [英] save multiple row in gridview on click of single button outside of gridview

查看:85
本文介绍了单击gridview外部的单个按钮,在gridview中保存多行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在用C#制作一个项目.在gridview中,我有两个三列ID,状态和注释.
对于状态,我在gridview列中使用了两个单选按钮.所以在我的gridview的每一行中,我在状态栏中有一个单选按钮,在注释栏中有一个文本框.
为保存更改,我在gridview之外使用了一个按钮.用于更新数据库中的更改.
我希望当用户单击保存hanges"按钮时,仅对注释或状态已更改的那些ID执行更新查询.意味着我不想为gridview的每一行执行更新查询.
所以我不明白我怎么会发现在哪个行中文本框的值被更改或未更改.

请给我任何想法.

在此先感谢

Hello Every One,

I am making a project in c#. In a gridview i have two three columns ID, status, comment.
for status i have used two radio button in gridview column. so in my gridview''s every row i have one radio button in status column and one textbox in comment column.
fo save changes i use a button outside of the gridview. for update the changes in database.
I want that when user click on save hanges button then update query should be execute only for those ID in which comment or status has been changed. Means i don''t want to execute update query for every row of gridview.
so i am not understand taht how i will find that in which row textbox value is changed or not.

please giveme any idea.

thanks in advance

推荐答案

您可以添加一个隐藏字段
您可以在其中将从服务器接收的数据存储为字符串
按下按钮时
您可以比较网格视图和隐藏字段的数据
如果进行了任何更改,则保存其他明智的跳过...
you can add a hiddend field
in which you can store you data received from server as a string
when button press
you can compare data of grid view and hidden field
if any changed made then save other wise skip ...


这篇关于单击gridview外部的单个按钮,在gridview中保存多行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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