Reload Databound Checked List Box

Stimulsoft Reports.NET discussion
Post Reply
mmurdock
Posts: 94
Joined: Tue Mar 20, 2007 4:59 pm

Reload Databound Checked List Box

Post by mmurdock »

How can I tell a data bound checked list box to reload it's data after a data source has changed? Also is there a way to have keys associated with items in a checked list box?

Thanks!

Mat Murdock
Guest
Posts: 182
Joined: Tue Jun 06, 2006 8:04 am

Reload Databound Checked List Box

Post by Guest »

You can access to the standard .Net CheckedListBox component via StiCheckedListBoxControl.Control property. This property allows access to a collection of the checked items.

What about your fist question - data should be reload automatically, is it not?

Thank you.
mmurdock
Posts: 94
Joined: Tue Mar 20, 2007 4:59 pm

Reload Databound Checked List Box

Post by mmurdock »

So I have a form with a Checked List Box on it an it's linked to a datasource. Have have that datasource set to NOT connect on start because I want to allow the user to enter in some information to filter the data. When they hit the OK button I have a line that says "students.connect" where students is the name of the datasource. After this I need it to populate the Checked List Box with the results. This is not happening. So I thought I might need to tell the Checked List Box the the datasource has changed and it needs to reload.

Thanks,

Mat
mmurdock
Posts: 94
Joined: Tue Mar 20, 2007 4:59 pm

Reload Databound Checked List Box

Post by mmurdock »

What id need a reload, requery, or resetbindings method. That method would causes a control bound to the BindingSource to reread all the items in the list and refresh their displayed values.

Thanks,

Mat
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Reload Databound Checked List Box

Post by Vital »

You can use following code:

Code: Select all

object [] values = Stimulsoft.Report.Dictionary.StiDataColumn.GetDatasFromDataColumn(this.Dictionary, "Categories.CategoryName");
Array.Sort(values);

ListBox1.Control.Items.Clear();
ListBox1.Control.Items.AddRange(values);
Thank you.
Post Reply