Hi
I using UltraWinGrid in my VB.NET windows application. I have two unbound columns in my Grid.
I have written code in Grid_InitializeLayout event to add unbound columns.
I want to set values in the unbound columns based on the values in the others cells of every row.
I have used Grid_Initializerow event to do this. This event is fired when i set the Datasource to the grid and the values are set in the unbound cells as per the condition given.
But this event is fired again when i change the values in the unbound columns and the values are set again.
Can i prevent the Initializerow event from firing when user edits the unbound columns?
What is the best way to bind values to unbound columns based on the values in the other cells?
Ashok
Hi Ashok,
You should check the e.ReInitialize property inside InitializeRow to see if the row is being initialized for the first time or not. So only set the unbound cell value when e.ReInitialize is false.
Hi Mike
I am adding unbound columns in Grid_InitializeLayout event. When i assign the datasource to the Ultragrid, Grid_InitializeRow event is fired first and then it goes to Grid_InitializeLayout.
So in Grid_InitializeRow event When i access the unbound cell using column key it gives an error "Key not found"
Grid_InitializeRow is also fired when i change the values in the cell and causing problems.
Is there any other work around to bind values to Unbound columns(only when datasource is assigned to Grid) based on the values in other cells of the row??