G
Guest
I have used the following code, but I get an error. I'm using C#. When the
checkbox is selected, I want to select all items in lstTeams (90 items) so
the user doesn't have to manually select each item:
private void chkAllTeams_CheckedChanged(object sender, System.EventArgs e)
{
//If the user selects "Select All Teams" checkbox, highlight (select all
items).
lstTeams.SelectionMode=SelectionMode.MultipleSimple;
// Loop through all items the ListBox (lstTeams).
for (int x = 0; x < lstTeams.Items.Count; x++)
{
lstTeams.SelectedIndex = x;
}
}
The error is: The type or namespace name 'SelectionMode' could not be found
(are you missing a using directive or an assembly reference?)
Is there a using System.? that I need to include to get Listbox property to
display?
checkbox is selected, I want to select all items in lstTeams (90 items) so
the user doesn't have to manually select each item:
private void chkAllTeams_CheckedChanged(object sender, System.EventArgs e)
{
//If the user selects "Select All Teams" checkbox, highlight (select all
items).
lstTeams.SelectionMode=SelectionMode.MultipleSimple;
// Loop through all items the ListBox (lstTeams).
for (int x = 0; x < lstTeams.Items.Count; x++)
{
lstTeams.SelectedIndex = x;
}
}
The error is: The type or namespace name 'SelectionMode' could not be found
(are you missing a using directive or an assembly reference?)
Is there a using System.? that I need to include to get Listbox property to
display?