将Checked DetailsView行添加到新的DataTable [英] Add Checked DetailsView Rows to a new DataTable

查看:72
本文介绍了将Checked DetailsView行添加到新的DataTable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里,我创建了一个包含joblist的grideview。下面我添加了一个datadetailview。当任何人选择gridview中的行时,它将在详细视图中显示...我在detailview中添加了一个列复选框。当有人选中复选框并单击应用下面的按钮,必须将详细视图中的数据添加到另一个应用的作业表中。我们可以这样做吗?

解决方案

On 应用按钮单击事件,做以下事情。


Here I created a grideview containging joblist.below that i added one datadetailview .when anybody select the row in gridview it will shown in detail view...I added one column checkbox in the detailview.when anbody select the checkbox and click apply button below ,the data in the detailview must be added to another table applied jobs.how can we do that?

解决方案

On Apply Button Click Event, do the following things.

  • Initialize a new DataTable
  • Loop through the DetailsView Items/Rows. Inside the loop...

    • Get the CheckBox Control by FindControl or something
    • Determine if it is Checked or not by CheckBox.Checked Property[^]
    • If that is checked add that Row to the new DataTable initialized before the loop

  • Now do anything you want to do with the new DataTable


这篇关于将Checked DetailsView行添加到新的DataTable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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