ListBox Event
-
I have two listboxes on a webform. One has a list of groups in it, and the other will have the members of the group depending on what index is selected in the group listbox. I am handeling the SelectedIndexChanged event of the Group list box so that I can change the contents of the second listbox. The problem is that the event doesn't seem to be firing:
protected void GroupList\_SelectedIndexChanged1(object sender, EventArgs e) { //get what group has been selected int index = GroupList.SelectedIndex; // get all the mounts in the group DataRow\[\] rows = dSet.Tables\["Mounts"\].Select("Group\_Number =" + GroupList.Items\[index\].Text); // Clear the previous mount list foreach (ListItem item in MountList.Items) { MountList.Items.Remove(item); } //Display the mounts in the group foreach (DataRow row in rows) { MountList.Items.Add(row\[0\].ToString()); } }
Any Ideas? Thanks for any responses ;)
-
I have two listboxes on a webform. One has a list of groups in it, and the other will have the members of the group depending on what index is selected in the group listbox. I am handeling the SelectedIndexChanged event of the Group list box so that I can change the contents of the second listbox. The problem is that the event doesn't seem to be firing:
protected void GroupList\_SelectedIndexChanged1(object sender, EventArgs e) { //get what group has been selected int index = GroupList.SelectedIndex; // get all the mounts in the group DataRow\[\] rows = dSet.Tables\["Mounts"\].Select("Group\_Number =" + GroupList.Items\[index\].Text); // Clear the previous mount list foreach (ListItem item in MountList.Items) { MountList.Items.Remove(item); } //Display the mounts in the group foreach (DataRow row in rows) { MountList.Items.Add(row\[0\].ToString()); } }
Any Ideas? Thanks for any responses ;)
Why aren't you using DataBinding?
Sean89 wrote:
The problem is that the event doesn't seem to be firing:
"Seem to be" does not help. It either does or does not, which is it? If it is not firing then something is not set correctly.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum led mike
-
Why aren't you using DataBinding?
Sean89 wrote:
The problem is that the event doesn't seem to be firing:
"Seem to be" does not help. It either does or does not, which is it? If it is not firing then something is not set correctly.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum led mike