Hi Christian,
Sorry for the delay in getting back to you. Thanks for your patience.
Please make the following changes to the CellButtonClicked event in Form1.cs of the CellButtons sample, to control the CellButtonClicked event to fire only when the button is shown for the currentcell.
private void gridControl1_CellButtonClicked(object sender, GridCellButtonClickedEventArgs e)
{
GridCurrentCell cc = this.gridControl1.CurrentCell;
GridRangeInfo rg = GridRangeInfo.Cell(e.RowIndex, e.ColIndex);
if (e.ColIndex == 5 && cc.HasCurrentCellAt( e.RowIndex, e.ColIndex ))
{
MessageBox.Show( "Clicked button at " + rg.ToString() );
}
else
e.Cancel = true;
}
Let us know if this helps.
Regards,
Rajagopal