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
close icon

Lost Binding Context

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

2 Replies

AD Administrator Syncfusion Team February 14, 2003 08:55 AM UTC

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.

MR Mike Reynolds February 14, 2003 11:28 AM UTC

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

Live Chat Icon For mobile
Up arrow icon