Hi
Ive added several charts to the chart list box called ChartListbox1
eg. public Steema.TeeChart.ChartListBox chartListBox1;
Im trying to read how many charts have been selected. So Ive tried both of the following.
int a = theController.chartListBox1.SelectedIndices.Count;
int b = theController.chartListBox1.SelectedItems.Count;
However a and b are only ever set to 1 even when I have 3 charts selected.
Am I reading the correct properties?
Trying to read the number of selected items in ChartListBox
Hi Dave,
We aren't sure to understand what are you exactly trying to do here.
Please, could you send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
We aren't sure to understand what are you exactly trying to do here.
Please, could you send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Yeray
I could do that but may take some time. Perhaps I can try explaining again.
I have a ChartListBox control that displays a list (of Series) with checkboxes beside each. I just want to be able to count how many checkboxes are Checked. When the checkbox is checked the series is displayed on the Chart. So there can be say 1-10 series diplayed on the chart.
If you need more info let me know.
I could do that but may take some time. Perhaps I can try explaining again.
I have a ChartListBox control that displays a list (of Series) with checkboxes beside each. I just want to be able to count how many checkboxes are Checked. When the checkbox is checked the series is displayed on the Chart. So there can be say 1-10 series diplayed on the chart.
If you need more info let me know.
Hi Dave,
You could count the active series as follows:
You could count the active series as follows:
Code: Select all
int total = 0;
for (int i = 0; i < chartListBox1.Items.Count; i++)
{
if (chartListBox1.Series(i).Active)
total += 1;
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Hi Dave,
ChartListBox inherits from .NET framework's system.windows.forms.listbox. You can see SelectedIndices and SelectedItems explanations and examples at msdn.
Maybe, if you are doing some changes and you want to force the chart to update internal calculations:
ChartListBox inherits from .NET framework's system.windows.forms.listbox. You can see SelectedIndices and SelectedItems explanations and examples at msdn.
Maybe, if you are doing some changes and you want to force the chart to update internal calculations:
Code: Select all
tChart1.Refresh();
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |