回复 8楼zhou_sir的帖子
测试代码如下:
- <html xmlns="http://www.w3.org/1999/xhtml" >
- <head runat="server">
- <title>Untitled Page</title>
- <script type="text/javascript" language="javascript">
- function Button1_onclick() {
- var spread = document.getElementById("<%=FpSpread1.ClientID%>");
- for(var i=0;i<=spread.GetColCount()-1;i++)
- {
- spread.SizeToFit(i);
- }
- }
- </script>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <FarPoint:FpSpread ID="FpSpread1" runat="server" BorderColor="Black" BorderStyle="Solid"
- BorderWidth="1px" Height="200" Width="400">
- <CommandBar BackColor="Control" ButtonFaceColor="Control" ButtonHighlightColor="ControlLightLight"
- ButtonShadowColor="ControlDark">
- </CommandBar>
- <Sheets>
- <FarPoint:SheetView SheetName="Sheet1">
- </FarPoint:SheetView>
- </Sheets>
- </FarPoint:FpSpread>
- <input id="Button1" type="button" value="button" onclick="return Button1_onclick()" />
- </div>
- </form>
- </body>
- </html>
复制代码 |