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.

GDBG Class in two forms behaves like one grid??

Thread ID:

Created:

Updated:

Platform:

Replies:

22252 Dec 7,2004 07:15 PM Dec 8,2004 01:49 AM Windows Forms 1
loading
Tags: GridControl
Lori S. Pearsall
Asked On December 7, 2004 07:15 PM

I''ve created a UserControl class named EventGrid that contains GDBG inside of a GridRecordNavigationControl (not using panes). I use this class in two different MDI forms (call them CaseWindow & TimelineWindow). Each of these forms does a "new EventGrid()". When I have both forms displayed at the same time, the grid in each form acts like it''s the same grid as opposed to two instances. For example, if I double-click to sort the grid in one window, it sorts the same way in the other window. What am I missing?? Thanks in advance!

Administrator [Syncfusion]
Replied On December 8, 2004 01:49 AM

You probably have 2 grids linked to the same DataSource using the same CurrencyManager. If the grids are using the same CurrencyManager (BindingContext), then any change to one one CurrencyManager (like a sort) will be reflected in the other. After you have created the grid and added it to the RecNavControl, try setting grid.BindingContext = new BindingContext(); This should make sure each grid is using a different BindingContext object. Another solution would be to create a new DataView object for each DataSource. So, if you are using a DataTable dt as the DataSource, you could try using: grid.DataSource = new DataView(dt); This should also prevent sorting/filtering one grid affecting the other.

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.

;