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

GDBG Class in two forms behaves like one grid??

Thread ID:





22252 Dec 8,2004 12:15 AM UTC Dec 8,2004 06:49 AM UTC WinForms 1
Tags: GridControl
Lori S. Pearsall
Asked On December 8, 2004 12:15 AM UTC

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 06:49 AM UTC

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.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon