Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Event for MANUALLY changed cell value?

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

Event for MANUALLY changed cell value?
Link Posted: 29-May-2006 00:44
Hi,

is there an event available that only triggers when the user changes a cell value manually via an in cell editor? There are a couple reasons why I can not use OnNodeCellChanging.

Thanks,

Tom
Link Posted: 29-May-2006 05:35
Use NodeCellChange event for this purpose.
NodeCellChanging event needs to validate value, when value is validated - cell value is changed and NodeCellChange is fired.
If you need to handle only manual node cell value changing, and do not handle changes made in code you should embrace node cell changes code into FlyGrid.BeginInit/EndInit:
[c#]
flyGrid.BeginInit();
try
{
  for(int i=0; i < flyGrid.Rows.Items.Count; i++)
  {
     flyGrid.Rows.Items[i][\"someField\"] = i;
  }
}
finally
{
  flyGrid.EndInit();
}


or use make changes:
[c#]
int cellIndex = this.Columns.FieldMapIndexOf(\"someField\");
for(int i=0; i < flyGrid.Rows.Items.Count; i++)
{
  NodeBase node = flyGrid.Rows.Items[i];
  object[] value = node.Value as object[];
  value[cellIndex] = i;
}
Link Posted: 29-May-2006 05:42
Hm, no that doesn't work for me. As you know I'm working with high frequent cell updates and thus they need to continue updating while I enter something in one cell. However, I don't want to store the value that I enter in the cell. It should act more like a command shell and when I hit enter, it reverts back to the old value and some action is triggered based on what I entered in the cell. I know that I could do this be NodeCellChanging and return false, however for performance reasons I don't want to use this method as it's called everytime a value is set into a cell. Thus, I want an event that is only triggered when somebody enteres something manually.
Link Posted: 29-May-2006 06:53
I think, you can implement BusinessObjects-like dataprovider and use as datasource with FlyGrid.Net.