回复 3楼shone的帖子
可以在鼠标移入 Cell 时设置该列宽度,从而显示完整字符串,鼠标移除时设置该列宽度为默认值:
后台代码:
- protected override void Render(HtmlTextWriter writer)
- {
- Table viewport = this.FpSpread1.FindControl("viewport") as Table;
- viewport.Rows[0].Cells[0].Attributes.Add("onmouseover", "mousehover()");
- viewport.Rows[0].Cells[0].Attributes.Add("onmouseout", "mouseout()");
- base.Render(writer);
- }
复制代码
前台代码:
- <script type="text/javascript">
- function mouseout() {
- var spread = this.document.getElementById("<%=FpSpread1.ClientID %>");
- spread.setColWidth(0, 90);
- }
- function mousehover() {
- var spread = this.document.getElementById("<%=FpSpread1.ClientID %>");
- spread.setColWidth(0, 240);
- }
- </script>
复制代码 |