从用户获取单个输入并需要更新使用gridview从数据库检索的完整列(使用复选框) [英] Taking a single input from user and need to update a complete column (using checkboxes) which is being retrieved from a database using gridview

查看:50
本文介绍了从用户获取单个输入并需要更新使用gridview从数据库检索的完整列(使用复选框)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

checkall-checkbox-gridview-aspnet

我几乎试图按照上面显示的链接进行操作..但我的要求是首先通过使用''复选框''&选择所需行来过滤行来更新列中的所有行。然后是''button_click''逻辑.. !!



希望你们都得到我的要求和改进。建议大多受欢迎。谢谢!!。

checkall-checkbox-gridview-aspnet
I am almost trying to do as in the link shown above..but my requirement is to update all rows in column firstly by filtering the rows by selecting required rows using ''checkbox'' & then on a ''button_click'' logic..!!

Hope you all got my requirement and improvements. Suggestions are mostly welcomed..Thank you!!.

推荐答案

循环遍历gridview行并找到复选框。如果选中了复选框,则更新数据表。试试这个:

Loop through the gridview rows and find the checkbox. If your checkbox is checked then update the datatable. Try this:
foreach (GridViewRow row in grid.Rows)
{
   if (((CheckBox)row.FindControl("chkboxid")).Checked)
   {
       //read the label for id and according to the ID update the datatable
   }
}







--Amit




--Amit


这篇关于从用户获取单个输入并需要更新使用gridview从数据库检索的完整列(使用复选框)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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