Posted 29 April 2019, 12:46 am EST
Hi Kamal,
We are sorry, the CheckBox click can also be handled by using ButtonCommand event. You may add condition check to detect if the event is raised because of the Button or CheckBox.
However, we have created an enhancement request for the same. We will share the request id soon.
As you said, each row’s first cell contains CheckBox, you may use the following code snippet:
protected void Page_Load(object sender, EventArgs e)
{
FpSpread1.ButtonCommand += FpSpread1_ButtonCommand;
if (!IsPostBack)
{
FpSpread1.ActiveSheetView.RowCount = 3;
CheckBoxCellType cell= new FarPoint.Web.Spread.CheckBoxCellType();
cell.AutoPostBack = true;
cell.Text = "Some text";
FpSpread1.ActiveSheetView.Cells[0, 0].CellType = cell;
FpSpread1.ActiveSheetView.Cells[1, 1].CellType = new FarPoint.Web.Spread.ButtonCellType("OneCommand", FarPoint.Web.Spread.ButtonType.ImageButton, "images/addtocart.gif");
FpSpread1.ActiveSheetView.Cells[2, 2].CellType = new FarPoint.Web.Spread.ButtonCellType("OneCommand", FarPoint.Web.Spread.ButtonType.LinkButton, "www.fpoint.com");
}
}
private void FpSpread1_ButtonCommand(object sender, SpreadCommandEventArgs e)
{ // first column containg checkbox
if (((System.Drawing.Point)e.CommandArgument).Y == 0)
{
// code for checkbox click
}else{
// code for Button Click
}
}
}
Hope it helps!
Regards,
Manish Gupta