找回密码
 立即注册

QQ登录

只需一步,快速开始

wlp5402

银牌会员

51

主题

145

帖子

2828

积分

银牌会员

积分
2828

活字格认证

wlp5402
银牌会员   /  发表于:2012-7-5 12:16  /   查看:11205  /  回复:17
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test2.aspx.cs" Inherits="test2" %>

<%@ Register assembly="FarPoint.Web.Spread, Version=6.0.3505.2008, Culture=neutral, PublicKeyToken=327c3516b1b18457" namespace="FarPoint.Web.Spread" tagprefix="FarPoint" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager runat="Server" ID="ScriptManager1"></asp:ScriptManager>
        <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>
   
    </div>
    <FarPoint:FpSpread ID="FpSpread2" 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>
    </form>
</body>
</html>

//後台
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class test2 : System.Web.UI.Page
{
    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 = "yyyy-MM-dd";

        //dc.EnableOnClient = true;

        //dc.ShowEditor = true;

        //dc.OnClientDateSelectionChanged = "datechange";

        FpSpread1.ActiveSheetView.Columns[0].CellType = dc;
    }
}

17 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2012-7-5 13:48:00
沙发
回复 1楼wlp5402的帖子

使用楼主的代码,并没有出现问题:
Demo:VS 2010 &amp;&amp; Spread for .NET 6.0
5099.zip (34.72 KB, 下载次数: 1227)
回复 使用道具 举报
wlp5402
银牌会员   /  发表于:2012-7-5 14:10:00
板凳
回复 2楼iceman的帖子

是選擇日期後出錯, 你是沒有按下選擇的日期吧
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2012-7-5 15:30:00
地板
回复 3楼wlp5402的帖子

你好,问题已经重现,有结果进快通知楼主。
回复 使用道具 举报
wlp5402
银牌会员   /  发表于:2012-7-9 12:12:00
5#
回复 4楼iceman的帖子

請問能解決嗎?
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2012-7-9 16:27:00
6#
回复 5楼wlp5402的帖子

wlp5402 你好,
问题确认为产品 Bug,目前已经提交到产品组。
得到修正后,我们会发送邮件通知给你。
给你带来不便,很抱歉。
回复 使用道具 举报
wlp5402
银牌会员   /  发表于:2012-7-9 19:01:00
7#
回复 6楼iceman的帖子

好急呀,什麼時候能解決給我們呀,客戶急著要呢.
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2012-7-11 09:20:00
8#
回复 7楼wlp5402的帖子

Bug 可能会在新版本中修复,但是不确定新版本发布时间。
我一直在调试这个问题。楼主有线索希望一起交流。能否考虑使用 DateTimeCellType 或者 RegExpCellType  代替?
给你带来不便,很抱歉。
回复 使用道具 举报
wlp5402
银牌会员   /  发表于:2012-7-11 18:45:00
9#
回复 8楼iceman的帖子

DateTimeCellType 或者 RegExpCellType  怎麼讓它一定輸入的是yyyy-MM-dd呢?
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2012-7-12 10:07:00
10#
回复 9楼wlp5402的帖子

测试代码如下:

  1.             if (IsPostBack)
  2.                 return;
  3.             FarPoint.Web.Spread.RegExpCellType regex = new FarPoint.Web.Spread.RegExpCellType();
  4.             System.Globalization.DateTimeFormatInfo timeInfo=new  System.Globalization.DateTimeFormatInfo();
  5.             timeInfo.DateSeparator=&quot;-&quot;;
  6.             regex.DateTimeFormat = timeInfo;
  7.             regex.ErrorMessage = &quot;输入格式错误。正确格式为:yyyy-MM-dd&quot;;
  8.             regex.ValidationExpression = @&quot;\d{4}-\d{2}-\d{2}&quot;;
  9.             FpSpread1.ActiveSheetView.Cells[0, 0].CellType = regex;
复制代码

效果如

Untitled.png
回复 使用道具 举报
12下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部