liujs_grape 你好,
可以通过后台 UpdateCommand 实现:
方法描述:DateCalendarCellType 下属性 OnClientDateSelectionChanged 定义定义前台方法 Post 到后台 UpdateCommand 事件中。
参考代码:
前台:
- <style type="text/css">
- .test
- {
- background-color:Red;
- }
- </style>
- <script type="text/javascript">
- function datechange() {
- FpSpread1.UpdatePostbackData();
- FpSpread1.CallBack("Update");
- }
- </script>
复制代码 后台:- protected void Page_Load(object sender, EventArgs e)
- {
- FarPoint.Web.Spread.Extender.DateCalendarCellType dc = new FarPoint.Web.Spread.Extender.DateCalendarCellType();
- dc.Animated = true;
- dc.DateFormat = "MM/dd/yyyy";
- dc.EnableOnClient = true;
- dc.ShowEditor = true;
- dc.OnClientDateSelectionChanged = "datechange";
- FpSpread1.ActiveSheetView.Cells[0, 0].CellType = dc;
- }
- protected void FpSpread1_UpdateCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
- {
- FarPoint.Web.Spread.Extender.DateCalendarCellType dc = (FarPoint.Web.Spread.Extender.DateCalendarCellType)this.FpSpread1.Sheets[0].Cells[0, 0].CellType;
- dc.CssClass = "test";
- }
复制代码 |