回复 3楼hlb77219的帖子
hlb77219 你好,
由于我没有你的源码,所以无法重现你的问题。我使用下面代码可以正常显示日期:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- {
- return;
- }
- DataTable data = new DataTable();
- data.Columns.Add("col1", typeof(System.DateTime));
- data.Columns.Add("col2", typeof(System.Int32));
- data.Rows.Add(DateTime.Now, 11);
- data.Rows.Add(DateTime.Now, 11);
- data.Rows.Add(DateTime.Now, 11);
- data.Rows.Add(DateTime.Now, 11);
- int c=0;
- this.FpSpread1.Sheets[0].DataSource = data;
- this.FpSpread1.Sheets[0].AutoGenerateColumns = false;
- foreach (DataColumn col in data.Columns)
- {
- this.FpSpread1.Sheets[0].ColumnHeader.Cells[0, c].Text = "fdfdsf";
- this.FpSpread1.Sheets[0].Columns[c].DataField = col.Caption;
- c++;
- }
- FarPoint.Web.Spread.TextCellType txtype = new FarPoint.Web.Spread.TextCellType();
- this.FpSpread1.Sheets[0].Columns[0].CellType = txtype;
- }
复制代码 |