spread4+vs2008+ie7
服务端代码1
FarPoint.Web.Spread.Extender.AutoCompleteCellType ac = new FarPoint.Web.Spread.Extender.AutoCompleteCellType();
ac.CompletionInterval = 1;
ac.DelimiterCharacters = ";, :";
AjaxControlToolkit.TextBoxWatermarkExtender twe = new AjaxControlToolkit.TextBoxWatermarkExtender();
twe.WatermarkText = "输入'S'测试...";
ac.Extenders.Add(twe);
ac.FirstRowSelected = true;
ac.ServicePath = "WebService1.asmx";
ac.ServiceMethod = "GetAllNames";
ac.MinimumPrefixLength = 1;
ac.EnableCaching = true;
ac.ShowEditor = true;
FpSpread1.ActiveSheetView.Cells[0, 0].CellType = ac;
服务端代码2
[System.Web.Script.Services.ScriptService]
public class WebService1 : System.Web.Services.WebService
{
[WebMethod]
public string[] GetAllNames(string prefixText, int count)
{
ArrayList filteredList = new ArrayList();
string[] names = { "AzamSharp", "Scott", "Alex", "Mary", "John", "Ali", "Sam", "Sammy" };
foreach (string name in names)
{
if (name.ToLower().StartsWith(prefixText.ToLower()))
filteredList.Add(name);
}
return (string[])filteredList.ToArray(typeof(string));
}
}
客户端代码
<body>
<form id="form1" runat="server">
<div id="divData" style="width: 100%; height: 100%; position: absolute; top: 0px;left: 0px; z-index: 1; display: block;">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
</div>
<div id="divMask" style="width: 100%; height: 100%; background-color: #0000FF; position: absolute;top: 0px; left: 0px; z-index: 2; display: block;">
</br>YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
</div>
<div id="divEdit" style="position: absolute; top: 0px; left: 0px; z-index: 3; display: block;
width: 450px; height: 580px; background-color: #FFFFFF;">
<FarPoint:FpSpread ID="FpSpread1" runat="server" BorderColor="Black" BorderStyle="Solid"
BorderWidth="1px" Height="100%" Width="100%">
<CommandBar BackColor="Control" ButtonFaceColor="Control" ButtonHighlightColor="ControlLightLight"
ButtonShadowColor="ControlDark">
</CommandBar>
<Sheets>
<FarPoint:SheetView SheetName="Sheet1">
</FarPoint:SheetView>
</Sheets>
</FarPoint:FpSpread>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</div>
</form>
</body>
代码可正常运行,但当输入字符时下自动完成下拉框弹出会导致层divMask透明属性失效,如图:
输入时.jpg
(15.35 KB, 下载次数: 1348)
|
|