一个页面 上一次性加载300行, 十列 , 有四列是下拉选择框 页面加载是很慢. 不知道 有没有优化的地方, 下面是代码
#region 下拉框
List<tblDictionary> listD = new List<tblDictionary>();
ComboBoxCellType cmb = new ComboBoxCellType();
listD = GetDataDetail("水平向代码");
cmb.DataSource = listD;
cmb.DataMember = "请选择";
cmb.DataTextField = "fldname";
cmb.DataValueField = "fldkey";
cmb.UseValue = true;
cmb.AutoPostBack = false;
cmb.ShowButton = true;
this.FpSpread1.ActiveSheetView.Columns[6].CellType = cmb;
cmb = new ComboBoxCellType();
listD = GetDataDetail("垂直向代码");
cmb.DataSource = listD;
cmb.DataTextField = "fldname";
cmb.DataValueField = "fldkey";
cmb.UseValue = true;
cmb.AutoPostBack = false;
cmb.ShowButton = true;
this.FpSpread1.ActiveSheetView.Columns[7].CellType = cmb;
八,九列 同上
this.FpSpread1.ActiveSheetView.Columns[5].Width = 200;
this.FpSpread1.ActiveSheetView.Columns[5].Locked = true;
this.FpSpread1.ActiveSheetView.Columns[10].Visible = false;
#endregion
for (int i = 0; i < lisvw.Count; i++)
{
this.FpSpread1.ActiveSheetView.SetValue(i,0,lisvw.fldSampleCode);
this.FpSpread1.ActiveSheetView.SetValue(i, 1, lisvw.fldBottleCode);
this.FpSpread1.ActiveSheetView.SetValue(i, 2, lisvw.fldSamplingAddress);
this.FpSpread1.ActiveSheetView.SetValue(i, 3, lisvw.fldSamplingDate);
this.FpSpread1.ActiveSheetView.SetValue(i, 4, lisvw.fldSamplingHour);
this.FpSpread1.ActiveSheetView.SetValue(i, 5, lisvw.flditemName);
this.FpSpread1.ActiveSheetView.SetValue(i, 6, lisvw.fldSAMPH);
this.FpSpread1.ActiveSheetView.SetValue(i, 7, lisvw.fldSAMPR);
this.FpSpread1.ActiveSheetView.SetValue(i, 8, lisvw.fldTideTime);
this.FpSpread1.ActiveSheetView.SetValue(i, 9, lisvw.fldTideFlood);
this.FpSpread1.ActiveSheetView.SetValue(i, 10, lisvw.fldItem);
} |
|