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

Databoundgrid has too many columns

Thread ID:

Created:

Updated:

Platform:

Replies:

18336 Aug 27,2004 06:11 PM UTC Aug 28,2004 02:55 PM UTC Windows Forms 2
loading
Tags: GridControl
Mike Sue-Ping
Asked On August 27, 2004 06:11 PM UTC

I''m using a Databoundgrid. I want to change the datasource dynamically depending on the user''s selection. When the grid first appears, it looks fine for the dataset that I''ve assigned to it. However, when I change the dataset to a different one, the first dataset''s columns remain in the grid and a new set of columns are added to the right side of the original columns. I want the original columns to be removed and replaced with ones that correspond to the second dataset''s fields. How do I do this?

Administrator [Syncfusion]
Replied On August 27, 2004 06:24 PM UTC

A couple of things to try. You can try calling grid.Binder.InitializeColumns after resetting your datasource. You could set the grid''s datasource to null, change your dataset, and then reset the datasource. grid.BeginUpdate(); grid.DataSource = null; grid.DataSource = myNewDataTable; grid.EndUpdate(); grid.Refresh();

Administrator [Syncfusion]
Replied On August 28, 2004 02:55 PM UTC

Thanks for the reply Clay. It turns out that my datasource was incorrect. The grid works fine now. Mike >A couple of things to try. > > >You can try calling grid.Binder.InitializeColumns after resetting your datasource. > >You could set the grid''s datasource to null, change your dataset, and then reset the datasource. > >grid.BeginUpdate(); >grid.DataSource = null; > grid.DataSource = myNewDataTable; >grid.EndUpdate(); >grid.Refresh(); >

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

;