Posted 18 October 2017, 6:50 am EST
I’d like to use this technique, but I can’t quite decipher the code. Here’s the code from the link above . . .
FarPoint.Web.Spread.ComboBoxCellType cb = new FarPoint.Web.Spread.ComboBoxCellType(new string[] {"One", "Two", "Three"});
cb.ShowButton = true;
FpSpread1.ActiveSheetView.Cells[0, 0].CellType = cb;
FpSpread1.EnableClientScript = false;
private void FpSpread1EditCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
{
bool ap;
FarPoint.Web.Spread.Editor.IEditor ed;
ed = e.SheetView.Cells[e.CommandArgument, 0].Editor;
if (fpEditor is FarPoint.Web.Spread.IAutoPostBack)
{
ap = ((FarPoint.Web.Spread.IAutoPostBack) ed).AutoPostBack;
Response.Write(ap.ToString());
}
}
For this purpose, please assume a combobox called “cbo_Employees”. it will be a multicolumcombobox, and I know regular comboboxes already have a postback setting, but I can probably adapt this for what I need. Also, it’s the whole column that needs to be set, not an individual cell, and I’m not sure how to do that below . . .
Assume the combobox column is column 1 (not column 0).
Is what I have below correct? Please let me know
FarPoint.Web.Spread.ComboBoxCellType cbo_Employees = new FarPoint.Web.Spread.ComboBoxCellType(new string[] {"One", "Two", "Three"});
cb.ShowButton = true;
FpSpread1.Sheets[0].Columns[1].CellType = cbo_Employees;
FpSpread1.EnableClientScript = false;
private void FpSpread1EditCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
{
bool ap;
FarPoint.Web.Spread.Editor.IEditor ed;
ed = e.SheetView.Cells[e.CommandArgument, 1].Editor;
if (fpEditor is FarPoint.Web.Spread.IAutoPostBack)
{
ap = ((FarPoint.Web.Spread.IAutoPostBack) ed).AutoPostBack;
Response.Write(ap.ToString());
}
}
I have the feeling that this isn’t setting autopostback for the combobox in this entire column. Any suggestions?