Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi!

i have a form in which i have two combobox and a checked list box
c1, c2 and check1
c1 has 10 items
c2 has 7 items
check1 has 20 items

now i hav to select items from c1 and c2 and the check items from check1 to sql server

but i dont get how to relate the checked items with commbo box selected items

i have done till here but what to do further


for (int i = 0; i < comboBoxSelectModuleMRF.Items.Count; i++)
{
	for (int j = 0; j < comboBoxSelectRoleMRF.Items.Count; j++)
	{
		if (comboBoxSelectModuleMRF.SelectedIndex == i && comboBoxSelectRoleMRF.SelectedIndex == j)
		{
			string modulename = comboBoxSelectModuleMRF.SelectedItem.ToString();
			string rolename = comboBoxSelectRoleMRF.SelectedItem.ToString();
		}
	}
}



can you help me what to do next
Posted
Updated 27-Jul-11 2:39am
v2

1 solution

You have to select them all, or in sets ? Looping to check values that don't change makes no sense. If there's one selected index, then you know the value, you don't need to loop to find it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900