作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2006, Vol. 32 ›› Issue (2): 68-69,87.

• 软件技术与数据库 • 上一篇    下一篇

数据网格中的双向排序及其随意修改

颜波 1,孙宏波2,肖田元2   

  1. 1.华南理工大学电子商务学院,广州510006;2.清华大学自动化系,北京 100084
  • 出版日期:2006-01-20 发布日期:2006-01-20

Bidirectional Sort and Choosing a Row to Update or Delete by Click Any Cell in DataGrid

YAN Bo1, SUN Hongbo2, XIAO Tianyuan2   

  1. 1. College of E-business, South China University of Technology, Guangzhou 510006;2. Dept. of Automation, Tsinghua University, Beijing 100084
  • Online:2006-01-20 Published:2006-01-20

摘要: 总结了在DataGrid 中进行正、反双向排序的两种方法:分别利用Attributes 属性和利用ViewState 来保存排序表达式和排序方向,更方便用户浏览查阅;给出了点击DataGrid 的任一位置以选中一行的方法,更方便用户操作;还给出从表单输入控件修改(更新或删除)DataGrid 中所选择记录行的方法,以保证数据有效性验证。

关键词: 双向排序;更新;ASP.NET;数据网格;视图状态

Abstract: First, two methods to realize the bidirectional sorts including the ascendant sort order and the descendant sort order in the DataGrid through storing the sort expression and the sort direction by means of attributes and viewstate are summarized in order that the users browse and look up more conveniently; Second, the method to choose a row by click any cell in the DataGrid is given in order that the users could operate more conveniently; Third, the methods to update or delete the selected record row in the DataGrid from Web forms controls are given to ensure data validation.

Key words: Bidirectional sort; Update; ASP.NET; DataGrid; View state