我想要对绑定后的数据进行排序,并且在变更关键字段后按照此字段重新进行排序。不过,一直没有反映。
代码1 关键字段变更:
- protected void ChangAssessment()
- {
- string assComment = this.hiddenAssComment.Value;
- if(assComment == "U")
- {
- switch (fpList.ActiveSheetView.GetValue(fpList.ActiveSheetView.ActiveRow, 6).ToString()) //关键字段 第6列
- {
- case "A":
- fpList.ActiveSheetView.SetValue(fpList.ActiveSheetView.ActiveRow, 6, "S");
- fpList.ActiveSheetView.SetValue(fpList.ActiveSheetView.ActiveRow, 11, "4"); //关键字段变更同时 第11列的排序参照值也发生变更
- break;
- case "B":
- fpList.ActiveSheetView.SetValue(fpList.ActiveSheetView.ActiveRow, 6, "A");
- fpList.ActiveSheetView.SetValue(fpList.ActiveSheetView.ActiveRow, 11, "3");
- break;
- case "C":
- fpList.ActiveSheetView.SetValue(fpList.ActiveSheetView.ActiveRow, 6, "B");
- fpList.ActiveSheetView.SetValue(fpList.ActiveSheetView.ActiveRow, 11, "2");
- break;
-
- }
- }
- else if(assComment == "D")
- {
- switch (fpList.ActiveSheetView.GetValue(fpList.ActiveSheetView.ActiveRow, 6).ToString())
- {
- case "S":
- fpList.ActiveSheetView.SetValue(fpList.ActiveSheetView.ActiveRow, 6, "A");
- fpList.ActiveSheetView.SetValue(fpList.ActiveSheetView.ActiveRow, 11, "3");
- break;
- case "A":
- fpList.ActiveSheetView.SetValue(fpList.ActiveSheetView.ActiveRow, 6, "B");
- fpList.ActiveSheetView.SetValue(fpList.ActiveSheetView.ActiveRow, 11, "2");
- break;
- case "B":
- fpList.ActiveSheetView.SetValue(fpList.ActiveSheetView.ActiveRow, 6, "C");
- fpList.ActiveSheetView.SetValue(fpList.ActiveSheetView.ActiveRow, 11, "1");
- break;
-
- }
- }
- fpList.ActiveSheetView.SetValue(fpList.ActiveSheetView.ActiveRow, 10, "U");
- }
复制代码
代码2 排序设置:
- protected void SetSort()
- {
- //Sort
- SortInfo desc = new SortInfo(0, false);
- SortInfo[] si = new SortInfo[] { desc };
- this.fpList.ActiveSheetView.SortColumns(11, 1, si);
- fpList.SaveChanges();
- }
复制代码 |
|