【问题标题】:ASP.NET Gridview to hanlde Delete, Sorting and Paging of recordsASP.NET Gridview 处理记录的删除、排序和分页
【发布时间】:2012-04-27 06:30:28
【问题描述】:

我是 ASP.NET 的新手。

我正在使用 DataGrid 设计一个 ASP.NET 页面,我将在其中执行以下任务。请提出最佳方法。

1) 在 Grid 上显示来自 DB 的记录,如下所示(启用分页)

Cloum1|Colum2|Column3|<CheckBox>
--------------------------------
Colva1|Colva4|Colvaa3|<CheckBox>
Colva1|Colva4|Colvaa3|<CheckBox>
Colva1|Colva4|Colvaa3|<CheckBox>
Colva1|Colva4|Colvaa3|<CheckBox>
Colva1|Colva4|Colvaa3|<CheckBox>
Colva1|Colva4|Colvaa3|<CheckBox>
Colva1|Colva4|Colvaa3|<CheckBox>
Colva1|Colva4|Colvaa3|<CheckBox>

            [DELETE Button]

{Solution proposed: Upon load event of the page bind grid with List of entities retrieved from the DB on grid using DataBind(), enable sorting, and paging (currently doing paging and sorting on post back events :()}
{Required help: best approach in doing paging and sorting on the gird with considering performance??}


2)Deleting records :
    -User should be able to navigate to multiple pages on the grid, and should be able to check records which he want to delete form
    {Solution proposed: Upon load event of the page bind grid with List of entities retrieved from the DB on grid using DataBind()}
    -After clicking on Delete button all the records from the DB should be removed.
    {Solution proposed- on Delete button submit click run delete operation using ADO.NET via SP on all the selected records.}
    {Required help: Best approach in this case, how to track the number of records selected for Delete on multiple pages}
    -Incase user sorts the records on the page they shouldn't do a post back instead maintain the state of whether records are checked for delete.
    {Required help: unsure on how to handle this??}

谢谢。

【问题讨论】:

    标签: asp.net datagridview pagination postback gridview-sorting


    【解决方案1】:

    Add, Edit, update, Delete gridview文章Add, Edit, update, Delete gridview的ASP.Net网格视图中有一个一步一步的做Edit/Update,delete的过程


    在分页检查时保持复选框状态:Maintaining State of CheckBoxes While Paging in a GridView Control

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-11-29
      • 1970-01-01
      • 1970-01-01
      • 2012-02-06
      • 1970-01-01
      • 1970-01-01
      • 2010-10-16
      相关资源
      最近更新 更多