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.

Changing bound columns in real time

Thread ID:





10086 Jan 21,2004 11:06 PM Jan 22,2004 01:29 AM Windows Forms 1
Tags: GridControl
Asked On January 21, 2004 11:06 PM

I want to change the bound columns in a databound grid while retaining the dataset. I want to be able to do this for 2 reasons. 1) i want the user to be able to add and remove columns 2) i want to change the entire set of visible columns to another subset without having to recreate the grid (lets say i show 10 out of a possible 50 and i have a combobox to decide which subset). I have achieved this but i can actually see each column appearing and it takes a few seconds to add them. How can I prevent this flickering. I''ve tried suspending the layout but that doesnt make a difference. Also if i remove the columns and add new ones then i have to reset the datasource to see the data. Why is this? --- this.SuspendLayout(); this.Model.SuspendChangeEvents(); this.GridBoundColumns.Clear(); foreach (string col in colNames) { GridBoundColumn gbc = new GridBoundColumn(); gbc.MappingName = col; gbc.ReadOnly = true; this.GridBoundColumns.Add(gbc); } this.Model.ResumeChangeEvents(); this.ResumeLayout(); this.Refresh();

Administrator [Syncfusion]
Replied On January 22, 2004 01:29 AM

Try sandwiching your code with these calls: grid.BeginUpdate(); grid.Binder.SuspendBinding(); //your code grid.Binder.ResumeBinding(); grid.EndUpdate() //and possibly (if needed) //grid.Refresh();


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.