We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridGroupingControl and the IBindingList Demo: how to update child lists?

Hi,

I attached the IBindingListDemo modified to support a child list inside the base object "Data".
I created a button to update first record in the datasource: the grid updates itself accordingly, but not the child list of the record.
How to force the grid to update also child lists?

Regards.

Attachment: bindinglistdemo_4e42d8dc.zip

5 Replies

NK Neelakandan Kannan Syncfusion Team June 19, 2015 09:24 AM UTC

Hi Maurizio,

Thank you for using Syncfusion products.

The reported scenario with “Child table does not updated as parent table” can be resolved by enabling the TableDirty property for child table which has been updated. So that please make use of below code to update parent and child table immediately,

Code Snippet:

private void button3_Click(object sender, EventArgs e)

{

dataSource[0] = new Data("CategoryIDnew", "Categorynew", "Descnew") { parameters=new SubDataCollection() {new SubData("anew"), new SubData("bnew"), new SubData("cnew")} };


//Used to update the parent table records

foreach (FieldDescriptor field in this.gridGroupingControl1.TableDescriptor.Fields)

{

field.ForceImmediateSaveValue = true;

}


//Used to update the child table

this.gridGroupingControl1.GetTable("parameters").TableDirty = true; //Child table name
}

Sample:
http://www.syncfusion.com/downloads/support/forum/119427/ze/Modified-binding-list-demo-99025530

Please let me know if you have any concerns.

Regards,
Neelakandan



MZ maurizio ziraldo June 22, 2015 04:43 PM UTC

Hi,

this solution works in the demo, but not in my real case.
If I add the lines of code, my child list is cleared: I view an empty child table in the grid.
In my real case the grid is "readonly"; the user can only view data. The IBindingList is updated by a background thread and the grid must show new values of records.
In this scenario the child list is erased by that code.
If I don't use the code snippet, the child list in the grid is filled when the IBindingList is created the first time, but not updated when the thread update the list.
Do I have to change something? 


NK Neelakandan Kannan Syncfusion Team June 23, 2015 04:23 AM UTC

Hi Maurizio,

Thank you for your update.

We have analyzed your reported scenario at our end. We tried all the possible ways to reproduce your reported scenario at our end. But unfortunately we could not able to reproduce. It is hard to trace why this issue occurred without seeing the sample. so that please provide us the minimal sample since you are customizing the data insertion as per your way(data will be updated based on thread). It would be more helpful for us to provide better solution as soon as possible. As a suggestion, you can refresh the grid once data is updated. Please make use of below code,

Code Snippet:

//Used to update the child table

this.gridGroupingControl1.GetTable("parameters").TableDirty = true;//Specify your needed child table which has been updated
this.gridGroupingControl1.Refresh();

Please let me know if you have any concerns.

Regards,
Neelakandan



MZ maurizio ziraldo June 24, 2015 11:10 AM UTC

Hi Neelakandan,

my real case is too complex to reproduce: I have a client .net that receive data from a sever java application and background threads must update the data in the grid.
Analyzing more my code, I saw a random behavior: sometime the child table is updated correctly, sometimes is erased; for example if I add styles as Metro Style, borders, etc. to the grid, it doesn't work more often.
I suspect a problem related to the threads that update almost simultaneously the datasource: every single element of the list is updated by a thread in a interval of time less than 100 millisecond.
Are there some optimization I can do?

Anyway, I will try to make a sample.
Thanks.


NK Neelakandan Kannan Syncfusion Team June 25, 2015 05:38 AM UTC

Hi Maurizio,

Thank you for your update.

We still could not able to reproduce your reported scenario at our end. It would be better to provide a solution if you provide any sample. So that we will wait until we hear from you. Until that you can use below optimization techniques provided in the below UG link:

http://help.syncfusion.com/ug/windows%20forms/Documents/memoryperformanceengineoptimizations.htm
http://help.syncfusion.com/ug/windows%20forms/Documents/listchangedperformance.htm
http://help.syncfusion.com/ug/windows%20forms/Documents/performance3.htm

Please let me know if you have any concerns.

Regards,
Neelakandan

Loader.
Live Chat Icon For mobile
Up arrow icon