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.

Deleting records from underlying datasource that is bound to ggc very slow

Thread ID:

Created:

Updated:

Platform:

Replies:

55100 Jan 23,2007 05:00 PM Jan 29,2007 04:59 AM Windows Forms 5
loading
Tags: Grouping
James Blibo
Asked On January 23, 2007 05:00 PM

I have a large flat datasource that is bound to a ggc. The ggc is grouped by one column via the GropDropArea. When the user selects the CaptionSummaryCell that represent a group and right-clicked, a context menu appears with the command, "delete records".

However, when I enumerate the RecordsInDetailCollection and called rec.Delete(), the process is painfully slow.

I'm not sure if this is a problem with the datatable (saw some posting about the datatable.remove(row) being very slow or a problem with the ggc.

Administrator [Syncfusion]
Replied On January 24, 2007 07:14 AM

Hi James,

Thank you for being patience.

Please refer to the following sample which demonstrates the intend behavior. This can be achieved by handling the TableControlCellMouseDown event and by making the context menu to pop up on caption summary row.

The records in the group are deleted by using Delete method of the record. The BeginUpdate and EndUpdate methods of TableControl have been called to make the grid to stop drawing, when it is being updated.

Sample : SummaryInCaption.zip

Kindly let us know if you need any further assistance.
Have a nice day.

Best regards,
Madhan

James Blibo
Replied On January 24, 2007 12:09 PM

BeginUpdate() and EndUpdate() seems to have speed things up. Thanks.

One problem though, when I check the recordcount of the underlying datasource, the record count still reflects the a vlaue that show that no records have been deleted.

Administrator [Syncfusion]
Replied On January 25, 2007 04:48 AM

Hi James,

Thank you for being patience.

In the following sample, the row count in dataset is being changed accordingly when deleting the records in the grid.

Sample : SummaryInCaption_25Jan07.zip

Are you using any database to populate in the grid? Then to reflect the changes to database, you need to update the data adapter for the changes made in the grid.

Kindly let us know if you need any further assistance.
Have a nice day.

Best regards,
Madhan

James Blibo
Replied On January 25, 2007 12:17 PM

Hi Madham:

Let me explain whats happening in my case.

I have two ggc (an upper master ggc and a lower ggc).
There are no physical relationship between the two datasets in the two grids. When the user right-click an bring up a context menu in the top grip and performs an action, for example, delete an item in a cell, I want to dynamically select the records in the lower grid the meet the criteria specific in the upper grid cell and perform some action on those rows.

My problem is selecting those rows in the lower grid. How do I select records that meet a certain criteria in the lower grid based on some condition when the lower grid does not have focus?

Administrator [Syncfusion]
Replied On January 29, 2007 04:59 AM

Hi James,

Thanks for being patience.

An idea is to use the GridConditionalFormatDescriptor and selecting the records based on the condition. For example, consider the grid 1 is been deleted, a condition is executed in grid2 and records will be selected.

The following is the code snippet, please try it and let us know if you need any further assistance.
>>>>>>>>>>>>>>>>>>Code Snippet <<<<<<<<<<<<<<<<<<<<
this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended;
GridConditionalFormatDescriptor desc = new GridConditionalFormatDescriptor();
desc.Expression = "[CustomerID] LIKE 'A*'";

this.gridGroupingControl1.TableDescriptor.ConditionalFormats.Add(desc);
foreach (Record rec in this.gridGroupingControl1.Table.Records)
if (desc.CompareRecord(rec))
this.gridGroupingControl1.Table.SelectedRecords.Add(rec); >>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<

Kindly let us know if you need any further assistance.
Have a nice day.

Best regards,
Madhan

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.

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.

;