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

How to allow to user to add records to GCC?

Thread ID:

Created:

Updated:

Platform:

Replies:

81384 May 19,2009 03:29 PM May 22,2009 05:31 AM Windows Forms 3
loading
Tags: GridControl
Vladimir Shcherbina
Asked On May 19, 2009 03:29 PM

Hi,

I want to provide user with a ability to add records (initially empties) to the GCC.
User will be able to press some small button in the GCC and add empty record. Then user can either fill it and save or switch to another grid (hide the whole grid and show another one). In case that user will return to the first grid, added records will be preserved. Any ideas?
I would greatly appreciate your help in this issue.
Best Regards,
Vladimir

Rajadurai C [Syncfusion]
Replied On May 20, 2009 10:29 AM

Hi Vladimir,

Thanks for your interest in Syncfusion products.

Please refer to the following sample in which this has been implemented.
http://files.syncfusion.com/support/samples/Grid.Windows/7.2.0.20/F81384.zip

In this sample, two datatables have been used. At runtime, new rows are added to the grid and editing can be made. When the second datatable is binded to the same grid, the rows which are added before remains saved in the first datasource. On rebinding the first one, the grid get loaded with saved(newly added) records.

Regards,
Rajadurai

Vladimir Shcherbina
Replied On May 20, 2009 12:19 PM

Hi,

Many thanks for your answer.
Actually I don't need to svae newly added record to the database yet. I need to know the following:

1) Which GGC callback (if any) will be called (and can it be overriden?), if user adds new record
2) Why GCC is not saving this record automatically. Every time that I switch to another grid and return back (by hiding the previous one and showing the new one) the added record is disappearing. How to change this behaviour withour updating GGC datasource?

Many thanks for your answers.
Best Regards,

Vladimir

Rajadurai C [Syncfusion]
Replied On May 22, 2009 05:31 AM

Hi Vladimir,

Thanks for your update.

1) The SourceListRecordChanged and SourceListListChanged events get triggerred once a new record has been added or a change to a record is made at grid level. Please refer to the following event handlers.

this.gridGroupingControl1.SourceListRecordChanged += new RecordChangedEventHandler(gridGroupingControl1_SourceListRecordChanged);
this.gridGroupingControl1.SourceListListChanged += new TableListChangedEventHandler(gridGroupingControl1_SourceListListChanged);


2) GridGroupingControl is a bounded one. When you made any changes in the grid, the underlying datasource get updated and it reflects the update in grid on leaving the current record after editing. This is the behavior of gridgroupingcontrol. Here the underlying datasource get updated means only the datastore binded to it. The original datasource cannot get updated by default. Hence after rebinding the grid with same datasource or closing the grid window and reopening, the data which are displayed initially in grid get displayed.

Switch to another grid and return back- will it mean changing datasource binded to grid or two seperate grids? Because hiding one grid and showing the other , doesn't make the grid to lose any change made into it.

Regards,
Rajadurai

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

;