Related List Boxes on Forms

Stimulsoft Reports.NET discussion
Post Reply
johnham
Posts: 98
Joined: Fri Sep 19, 2008 2:27 pm
Location: Richland, WA, USA

Related List Boxes on Forms

Post by johnham »

I have listbox#1 that I need to place lookup data in. Depending on the value selected I would like to refresh the data in listbox #2.

I have listbox #1 bound to the proper datasource and I have listbox #2 bound to a datasource that accepts an ID parameter from Listbox #1 but for the life of me I can't get listbox #2 to rebind the data in it so that it will see the new parameter I have passed to it as a filter.

I would like to find a way to do this purely using databinding and not with looping through the dataset for listbox #2 if possible.

Thanks,
John Hamilton
Hamilton & Company, LLC
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Related List Boxes on Forms

Post by Edward »

Hi John,

Is it a Web application or a Windows Forms application you are asking about?

Thank you.
johnham
Posts: 98
Joined: Fri Sep 19, 2008 2:27 pm
Location: Richland, WA, USA

Related List Boxes on Forms

Post by johnham »

WinForms
Thanks,
John Hamilton
Hamilton & Company, LLC
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Related List Boxes on Forms

Post by Jan »

Hello Johnam,

You need sign to SelectedIndexChangedEvent of Listbox#1. In this event you need place code similar to:

Code: Select all

ListBoxControl1.Items.Clear();

Customers.First();
while (!Customers.IsEof)
{
  if (condition)
  {
    ListBoxControl1.Items.Add(Customers.CompanyName);
    Customers.Next();
  }
}
Thank you.
johnham
Posts: 98
Joined: Fri Sep 19, 2008 2:27 pm
Location: Richland, WA, USA

Related List Boxes on Forms

Post by johnham »

I was looking for a way to use databinding. Like bind ListBox1 to a datasource and listBox2 to a second dataset which has a parameter for filtering base on values selected in the first list box. Once something is selected I should be able to set the parameter and reload the listBox2 or rebind listbox2 to its datasource.

Thanks,
John Hamilton
Hamilton & Company, LLC
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Related List Boxes on Forms

Post by Jan »

Hello,

Unfortunatelly report engine does not have tools to rebind data.

Thank you.
Post Reply