1.Excel 单元格默认时Locked的,而且cell的locked优先级高于行列,所以如果Cell设置了Locked true,需要通过代码重新设置为false
2. 用setselection设置
FpSpread1.ActiveSheetView.SelectionModel.SetSelection(0, 0, 1, FpSpread1.ActiveSheetView.ColumnCount);
或者 设置 OperationMode 为row,每次选择一行
FpSpread1.ActiveSheetView.OperationMode = OperationMode.RowMode;
FpSpread1.ActiveSheetView.ActiveRow = 0;
FpSpread1.ActiveSheetView.ActiveColumn = 0;
3. 可以在事件里加
- <script lang="javascript" type="text/javascript">
- window.onload = function () {
- var spread1 = document.getElementById("<%=FpSpread1.ClientID %>");
- if (document.all) {
- // IE
- if (spread1.addEventListener) {
- // IE9
- spread1.addEventListener("CallBackStart", CallBackStart, false);
- spread1.addEventListener("CallBackStopped", CallBackStopped, false);
- } else {
- // Other versions of IE and IE9 quirks mode (no doctype set)
- spread1.onCallBackStart = CallBackStart;
- spread1.onCallBackStopped = CallBackStopped;
- }
- }
- else {
- // Firefox
- spread1.addEventListener("CallBackStart", CallBackStart, false);
- spread1.addEventListener("CallBackStopped", CallBackStopped, false);
- }
- }
-
- function CallBackStart(event) {
- if (event==null) event = window.event;
- alert("start");
- }
-
- function CallBackStopped(event) {
- alert("stop");
- }
- </script>
复制代码 |