摘要: 总结了在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
颜波,孙宏波,肖田元. 数据网格中的双向排序及其随意修改[J]. 计算机工程, 2006, 32(2): 68-69,87.
YAN Bo, SUN Hongbo, XIAO Tianyuan. Bidirectional Sort and Choosing a Row to Update or Delete by Click Any Cell in DataGrid[J]. Computer Engineering, 2006, 32(2): 68-69,87.