Posted 22 March 2018, 5:17 pm EST
Hello,
The earlier post was deleted since it was not relevant to ASP.NET. You can directly export the Spread sheet to Excel with all the Combobox items. This is exported as validation list to Excel.
When you import you can choose to only import the Data shown in the validation cells and not validation list.
For example you can use the following approach:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string[] cbstr;
cbstr = new String[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun" };
FarPoint.Web.Spread.ComboBoxCellType cmbbx = new FarPoint.Web.Spread.ComboBoxCellType(cbstr);
FpSpread1.ActiveSheetView.Columns[1].CellType = cmbbx;
FpSpread1.ActiveSheetView.Cells[0, 0, 2, 0].Text = "Test";
}
}
protected void Button1_Click(object sender, EventArgs e)
{
FpSpread1.SaveExcel("C:\\Data\\excelfile.xlsx",FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat);
}
protected void Button2_Click(object sender, EventArgs e)
{
FpSpread1.Reset();
FpSpread1.OpenExcel("C:\\Data\\excelfile.xlsx", FarPoint.Excel.ExcelOpenFlags.ComboDataOnly | FarPoint.Excel.ExcelOpenFlags.TruncateEmptyRowsAndColumns);
}
Please refer to the sample application attached.
Thanks,
Deepak Sharma
SpreadWebexportExcelWithCombo.zip