Click here to Skip to main content
15,913,836 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
in My wpf application,i have 5 Combo-box (CB), and each CB bind 10 item (A,B,C,D,E,F,G,H,I,J) AND also have dynamic generated label (which will show group of combo box item).
so question is that when user select all combobox item then its show as grouping of this selected item.

example :

You are select

A
B
D
F
G
from combobox.
Posted

XML
<html>
<body>
<form name="form2" method="post" action="">
<select name="select1">
<optgroup id="optg1">
    <option id="opt1_1">first</option>
    <option>second</option>
    <option>third</option>
</optgroup>
<optgroup id="optg2">
    <option>first item in second group </option>
    <option id="opt2_2">second item in second group </option>
    <option>third item in second group </option>
</optgroup>
<script language="JavaScript">
    document.getElementById("optg1").label = "first group";
    document.getElementById("optg2").label = "second group";
</script>
</select>
</form>
</body>
</html>
 
Share this answer
 
In first Collect All Combo box selected Value in List then Grouping that

C#
var grouped = stuList.GroupBy(s => s.CollectedValue, m => m.count).Select(group => new { Cloth = group.Key,Total = group.Sum() });
                               listcal.ItemsSource = grouped;
 
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