Hi,
I am trying to fires an event when there is some text change in my grid. I tried AfterRowUpdate, AfterCellUpdate and BeforeRowUpdate. I don't know why when I just click a cell of a row, without changing anything, those event already fires.
thanks,
It's definitely a bug. Just delete the grid and create a new one and the problem disappear. so weird.
Actually the formula in the Grid_InitializeLayout cause those event fires when I click a row in the grid. I really need the formula there and need one of the event to fire after some text in the grid changed. Any idea, please help.
Thanks,
What version of the grid are you using?
It seems to me that if you have a formula in a bound column, then the AfterRowUpdate event has to fire when the value of that cell is calculated. I'm not sure about an unbound column.
Hi Mike,
Thank you for your response. I just update to the new version 8.3, but it's not helping.
I haven't try the unbound column yet. What I did before was adding a column to the datatable like this
datatable.Column.Add(new DataColumn("NewColumn", Type.GetType("System.Decimal"), "[Column1] / [Column2]"));
it works, but I don't like it much since I have to check for Column2 for zero value and have to rebind the datatable to the grid whenever the value of one of that column is changed. It's so inconvinience that way. Using the grid formula, I can take advantage of the change without doing anything. However, I have to update back to the database whenever the change in the cells happens. I have to find a way for the formula to work and get the AfterCellUpdate event fires the way it should be.
Thanks.
I tried to create unbound column as below
band.Columns["MyColumnName"].DataType = Type.GetType("System.Decimal");
band.Columns["MyColumnName"].Formula = "if ( [Column1] , [Column2] / [Column1], 0 )";
and the event AfterCellUpdate event still fires when I just click on one of the cell of the grid.
Is there anyway I can prevent this event to fires when I just click on the cell?
grid.EventManager.SetEnabled(GridEventIds.AfterRowUpdate, false);
Why not just check for which column is being updated in AfterCellUpdate? If it's a cacluated column, do nothing.
Or, you could use the AfterExitEditMode even.
I think CellChange event is the only one that I can use for my case.