回复 1楼syl000216的帖子
请参考以下代码:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- {
- return;
- }
- FarPoint.Web.Spread.Column col;
- col = FpSpread1.ActiveSheetView.Columns[1];
- FpSpread1.ActiveSheetView.Cells[0, 1].Text = "Alignment";
- FpSpread1.ActiveSheetView.Cells[1, 1].Text = "CarbAdjust";
- FpSpread1.ActiveSheetView.Cells[2, 1].Text = "Brakes";
- col.SortIndicator = FarPoint.Web.Spread.Model.SortIndicator.Descending;
- FpSpread1.ActiveSheetView.AllowSort = true;
- }
- protected void FpSpread1_SortColumnCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
- {
- //清除点击列头的选择范围
- this.FpSpread1.ActiveSheetView.SelectionModel.ClearSelection();
- //可以把之前的 Selection 存入 Session中
- this.FpSpread1.ActiveSheetView.SelectionModel.AddSelection(0, 0, 1, 1);
- }
复制代码 |