Hi,
I have derived a FormulacellModel to a custom cell model and all my cells in the Grid are set to this custom celltype. Inside the custom model I access a
CustomProperty and when the cell text changes I set the value to the customproperty.
I have overridden the TextBoxChanged/OnEditingComplete methods.
Now when I multi select cells and delete the event is fired only for the last cell in the selection. So the gird now shows empty value but when I access my customproperty the value is not cleared.
Can you let me know how to handle this?
HA
haneefm
Syncfusion Team
June 27, 2007 06:16 PM UTC
Hi Thanvir,
You can handle the Model.ClearingCells event and reset the CustomProperty there. Below are the code snippet to resolve this issue.
this.gridGroupingControl1.TableControl.Model.ClearingCells += new GridClearingCellsEventHandler(Model_ClearingCells);
private void Model_ClearingCells(object sender, GridClearingCellsEventArgs e)
{
Console.WriteLine( e.RangeList.ActiveRange);
}
Best regards,
Haneef
TH
Thanvir Hussain
June 27, 2007 06:21 PM UTC
Hi,
Thanks for the quick reply.
Is it possible to handle the clear event inside my customcellrenderer class, because I will be using this customcell across several girds and don't want to handle the clear event in each of the grid.
thanks
thanvir.
>Hi Thanvir,
You can handle the Model.ClearingCells event and reset the CustomProperty there. Below are the code snippet to resolve this issue.
this.gridGroupingControl1.TableControl.Model.ClearingCells += new GridClearingCellsEventHandler(Model_ClearingCells);
private void Model_ClearingCells(object sender, GridClearingCellsEventArgs e)
{
Console.WriteLine( e.RangeList.ActiveRange);
}
Best regards,
Haneef
HA
haneefm
Syncfusion Team
June 27, 2007 08:28 PM UTC
Hi Thanvir,
Yes. You need to subscribe the ClearingCells event in a customcellrenderer constructor and reset you custom property . Below are the code snippet.
public class customcellrenderer:GridStaticCellRenderer
{
public customcellrenderer():base()
{
this.Grid.Model.ClearingCells += new GridClearingCellsEventHandler(Model_ClearingCells);
}
private void Model_ClearingCells(object sender, GridClearingCellsEventArgs e)
{
Console.WriteLine( e.RangeList.ActiveRange);
}
}
Best regards,
Haneef