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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Using dropdown datasource doesn''t update when datasource has new items added

Thread ID:





15809 Jun 28,2004 01:48 PM UTC Jun 29,2004 06:39 AM UTC WinForms 4
Tags: GridControl
Administrator [Syncfusion]
Asked On June 28, 2004 01:48 PM UTC

Using dropdown datasource doesn''t update when datasource has new items added. I''m using a virtual grid and setting the datasource to an arraylist, when the arraylist is changed the dropdown seems to have a cached list of the orig items. How do i force it to update the list?

Administrator [Syncfusion]
Replied On June 28, 2004 02:15 PM UTC

You might try setting these static properties to to if this will handle the problem. It tells the grid to use a reference and not clone the object. GridStyleInfoStore.DataSourceProperty.IsCloneable = false; GridStyleInfoStore.DataSourceProperty.IsDisposable = false; Another way to do this would be to handle CurrentCellShowingDropDown and explicitly set teh dataSource at that point, but setting the properties is simpler if that works for you.

Administrator [Syncfusion]
Replied On June 28, 2004 04:54 PM UTC

found this in the code for the drop combo model it seems to check to see if the datasource has changed and the result is that it doesn''t update the internal lists datasource (obj1 == listBox.DataSource) I found that if i cloned my datasource then the list upadted.... seems like a ''Feature'' to me, perhaps there is someway of setting a flag to tell it to reset the source?

Administrator [Syncfusion]
Replied On June 28, 2004 06:08 PM UTC

When you change your datasource, you could try setting the listbox datasource to null. This should force the grid to reload it. GridComboBoxCellRenderer cr = (GridComboBoxCellRenderer) this.gridControl1.CellRenderers["ComboBox"]; cr.ListBoxPart.DataSource = null;

Administrator [Syncfusion]
Replied On June 29, 2004 06:39 AM UTC

Yep that fixed it for me... the useful bit i didn''t know about was getting hold of the listboxpart....


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon