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!
ADAdministrator Syncfusion Team 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.