Hi,
I have a grid and a string column in it. If the value is not Empty I will set the Style to Button else to Default.
The reason is the string defines the text of the button an an empty string meants no button.
so long no real problem.
i use a BindingList<> as Datasource
if the value of the string changes (also some other things in the grid change) the new value is drawn in the grid.
That's fine.
But the
AfterCellUpdate, AfterRowUpdate and also the AfterRowInsert Event is not fiering.but the Cell Value Change and a "child" row is added.
So I'm looking for a event that indicates the BindingList<> has changed and is new displayed. At the moment I use the Paint event ... it woks cause i have a very small grid but I think this is no good way.
Is there a event on the grid that I can use? In what cases does the value of a cell changed whitout firing a AfterCellUpdate event.
Or is there something else to change the style of a cell depending on the content of the cell?
Thanks
Wolfgang
Hi Wolfgang,
The InitializeRow event is perfect for what you want here. It fires the first time the row is created and also any time a value in the row changes.
Hi Mike,
thanks the InitializeRow is perfect for insert an update. But if I loos a row (cause the element is remove from Bindiglist) it do not fire. What I think probertly make sence.
Return to my Problem I have a Bindinglist of Typa A that is the DataSource of my Grid.
A has a Bindinglist of Type B as Property
B has a Bindinglist of Type C as Property
On code I Change the Elements B and C and add or remove them from there BindingList in A und B.
By the way the InitializeRow only fire if A, B and C implements INotifyPropertyChanged
At the moment I get the ListChanged of my first Bindinglist (of type A) and do there my Code cause i dont know what Event is fired if I remove a Element of the BindingList in A of Type B.
The row disapears as expected but what Event is Cause if a row is Deleted? Its not AfterRowsDeleted.
Any Idea what Event is Fired in this case? My current way works as well, but i woud like to let the Format be done by the sourounding source and not by my logic class,