Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
185
InitializeRow being called twice
posted

Hi Mike,

We have created a dataset with various tables and relations among them and wrapped the object in a BindingSource object before setting as data source of ultra grid object.

Now when we add new row to data tables at run time, InitializeRow gets called twice. Upon looking at call stack for both calls, I could distinguish that one call is raised through BindingSource.ListChanged event and another call is raised through DataView.OnListChanged event. Problem occurs when call through DataView brings in corroupted datarow associated with ultra grid row through ListObject property.

Can you please provide some help?

Is there any way that we can enforce InitializeRow should be called only once?

Thanks in advance

Parents
  • 469350
    Offline posted

    I'm afraid I don't understand the issue. What is this about corruption of the DataRow?

    The InitializeRow event is not support to only fire once. It fires quite often, and your code should not make the assumption that it will fire only once. It fires the first time the row is created and any time a value in the row is changed and under several other circumstances, as well. This is the intended behavior.

    You may want to check e.ReInitialize if there is some code that you only want to run the first time the row is initialized.

Reply Children