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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

119427 Jun 18,2015 12:35 PM Jun 25,2015 01:38 AM Windows Forms 5
loading
Tags: GridGroupingControl
maurizio ziraldo
Asked On June 18, 2015 12:35 PM

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

Neelakandan Kannan [Syncfusion]
Replied On June 19, 2015 05:24 AM

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


maurizio ziraldo
Replied On June 22, 2015 12:43 PM

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? 

Neelakandan Kannan [Syncfusion]
Replied On June 23, 2015 12:23 AM

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


maurizio ziraldo
Replied On June 24, 2015 07:10 AM

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.

Neelakandan Kannan [Syncfusion]
Replied On June 25, 2015 01:38 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;