When we add a new row using the "grid1.UserAddedRow" event, we update
the value one of the columns "Weighting" for each row with the even
spread of how many rows there are over 100 percent.
So if there are 3
rows initially, the "Weighting" field for each of the rows will be
"33.33%". As soon as we add a new row, which makes the total number of
rows 4,
we update the value of the "Weighting" field for each of the rows to "25.00%".
The issue occurs when we add our first row, instead of setting the "Weighting" to "100.00%", it sets it to "50.00%".
Logically this means that there must be another row that exists in the grid whilst the user added row event is firing.
When
the "grid1.UserAddingRow" event fires, there is one row but when the
"grid1.UserAddedRow" fires straight afterwards, the row count changes to
2.
Does the grid have another event that is adding a new row
whenever you add your first record to the grid? How can we prevent this
from happening?
the value one of the columns "Weighting" for each row with the even
spread of how many rows there are over 100 percent.
So if there are 3
rows initially, the "Weighting" field for each of the rows will be
"33.33%". As soon as we add a new row, which makes the total number of
rows 4,
we update the value of the "Weighting" field for each of the rows to "25.00%".
The issue occurs when we add our first row, instead of setting the "Weighting" to "100.00%", it sets it to "50.00%".
Logically this means that there must be another row that exists in the grid whilst the user added row event is firing.
When
the "grid1.UserAddingRow" event fires, there is one row but when the
"grid1.UserAddedRow" fires straight afterwards, the row count changes to
2.
Does the grid have another event that is adding a new row
whenever you add your first record to the grid? How can we prevent this
from happening?