• 周四. 4月 25th, 2024

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

dataList中实现用复选框一次删除多行问题

admin

11月 28, 2021
遍历每一行,判断checkBox是否选中,再获取选中行的主键Id  删除就行了 ,,,
foreach(DatalistRow rowview in Datalist.Rows) //遍历Datalist中的每一行
{
//假设你的Datalist中的复选框放在第一列,id是“CheckBox1”
CheckBox check = (CheckBox)rowview.Cells[0].FindControl("CheckBox1");//找到了checkbox控件

if(check.Checked)//如果被选中

{
...
//假设你把每一行的id放在第二列
string myid = rowview.Cells[1].text;//这就是所在行的id,赋值给了myid
....//作删除操作
}

}

《dataList中实现用复选框一次删除多行问题》有3个想法
  1. Wow, amazing weblog layout! How long have you been running a
    blog for? you make blogging look easy. The entire look of your
    site is magnificent, let alone the content material!
    You can see similar here ecommerce

  2. Just wish to say your article is as astounding.
    The clarity in your post is simply spectacular and i can assume you’re an expert on this
    subject. Well with your permission allow me to grab your feed to keep updated with forthcoming post.
    Thanks a million and please carry on the rewarding work.
    I saw similar here: Sklep online

  3. Howdy! Do you know if they make any plugins to assist with Search
    Engine Optimization? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good results.
    If you know of any please share. Thank you! You can read similar text here:
    E-commerce

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注