回复 5楼fmyuan2000的帖子
很抱歉,目前我没能找出更好的方法来解决这个问题。目前情况来看只能采用您电话中提到的逐个单元格设置combo类型。
另外,我通过附件demo没有能重现出这个问题,能否在我的demo基础上修改重现这个问题?
Demo中代码如下:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- {
- return;
- }
- DataTable city=new DataTable();
- city.Columns.AddRange(new DataColumn[] {new DataColumn("City", typeof(string)), new DataColumn("Owner", typeof(Int32)), new
- DataColumn("State", typeof(string))});
- city.Rows.Add(new object[] { "Atlanta", 0, "Georgia" });
- city.Rows.Add(new object[] { "Boston", 1, "Mass." });
- city.Rows.Add(new object[] { "Tampa", 2, "Fla." });
- FarPoint.Web.Spread.ComboBoxCellType cb = new FarPoint.Web.Spread.ComboBoxCellType();
- cb.DataSource = city;
- cb.ShowButton = true;
- cb.DataMember = "City";
- cb.DataTextField = "City";
- cb.DataValueField = "Owner";
- cb.UseValue = true;
- this.FpSpread1.ActiveSheetView.AllowPage = false;
- this.FpSpread1.ActiveSheetView.Rows.Count = 100;
- for (int i = 0; i < 100; i++)
- {
- FpSpread1.ActiveSheetView.Cells[i, 0].Value = 2;
- }
- FpSpread1.ActiveSheetView.Columns[0].CellType = cb;
-
- }
- protected void Button2_Click(object sender, EventArgs e)
- {
- this.FpSpread1.SaveExcel(this.Server.MapPath("1.xlsx"), FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat| FarPoint.Excel.ExcelSaveFlags.SaveAsViewed);
- }
- protected void Button3_Click(object sender, EventArgs e)
- {
- this.FpSpread1.OpenExcel(this.Server.MapPath("1.xlsx"));
- this.FpSpread1.ActiveSheetView.AllowPage = false;
- }
复制代码
重现后我会把这个问题反馈给产品组,看能否在后续版本中改进。 |