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.

Lost Binding Context

Thread ID:

Created:

Updated:

Platform:

Replies:

2797 Feb 13,2003 08:21 PM Feb 14,2003 06:28 AM Windows Forms 2
loading
Tags: GridControl
Mike Reynolds
Asked On February 13, 2003 08:21 PM

Here's a general binding questing I hope you can help me out with. I do the following steps: mainPanel.Controls.Clear() {create a GridDataBoundGrid and attach a DataSource} mainPanel.Controls.Add(GridDataBoundGrid1); {change the row position through the UI} mainPanel.Controls.Clear() mainPanel.Controls.Add(GridDataBoundGrid1) Now, after GridDataBoundGrid1 is re-shown, the row position gets set back to the beginning and the columns are re-sized. Can you suggest any way of preventing this. i.e. have the grid retain these settings while it is detached/reattached to a parent? Thank You

Administrator [Syncfusion]
Replied On February 14, 2003 03:55 AM

I think one way you might be able to handle this is to avoid the call to InitLayout when you add the GridDataBoundGrid back to the panel. Attached is one try at this. The idea is to derive a GridDataBoundGrid, add a field that you can test in the InitLayout override to determine whether or not to call the base method. Then you set this field before you clear the controls, and reset it after you add the grid back. There may be some other things that crop up that you need to handle, but this seems to avoid re-setting the layout.

Mike Reynolds
Replied On February 14, 2003 06:28 AM

YO! The way you guys handle this forum makes me very comfortable that I made the right choice in 3rd party components. Thank you very much. Keep up the good work! P.S. I also overrode OnParentChanged in order to monitor when I was going onto and comming off of a parent and set a flag accordingly

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.

;