Page 1 of 1
Reload Databound Checked List Box
Posted: Thu Dec 06, 2007 12:30 am
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
Reload Databound Checked List Box
Posted: Fri Dec 07, 2007 11:43 am
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.
Reload Databound Checked List Box
Posted: Fri Dec 07, 2007 12:21 pm
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
Reload Databound Checked List Box
Posted: Fri Dec 07, 2007 1:28 pm
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
Reload Databound Checked List Box
Posted: Mon Dec 10, 2007 11:03 pm
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.