0

I Have a enumeration class Status, which has enum values(say X, Y, Z, A, B, C) and these values are set in another class based on certain conditions.

Now I would like to create new comboBox item GroupM which would display A, B, C and similarly item GroupN which would display rows related to X, Y, Z:

How can I achieve that? I believe this may be vague requirement but this is the maximum I can explain.

Sinatr
  • 20,892
  • 15
  • 90
  • 319
  • 2
    Possible duplicate of [Grouping items in a combobox](http://stackoverflow.com/questions/3585017/grouping-items-in-a-combobox) – MaKCbIMKo Mar 15 '17 at 10:54
  • Hi this is not the duplicate of what I asked. I am asking that A,B,C,X,Y,Z are 6 rows obtained from enumeration. So on clicking of GroupM I should display all 3 rows A,B,C. It is not a Category and Elelment or Tree View which I am asking. Thanks for the link though. :) – Santhosh Rajoo Mar 15 '17 at 10:59
  • You mean that you want dynamically change the items in combobox? (at start you have 2: GroupA, GroupB. then you click GroupA, and items will be: A,B,C,GroupB - correct?) – MaKCbIMKo Mar 15 '17 at 11:03
  • No I want the single combobox items too. Including the single combobox items I need the grouping too – Santhosh Rajoo Mar 15 '17 at 11:08
  • 1
    Well, what does `Item (GroupM) which would display A,B,C` mean? if they already displayed...i'm confused. – MaKCbIMKo Mar 15 '17 at 11:11
  • Two comboboxes with different `ItemsSource`: one containing only `A, B, C` and other only `X, Y, Z`? Or two comboboxes, in one you choose `M, N` and other will display (based on first one): `A, B, C` or `X, Y, Z` ? – Sinatr Mar 15 '17 at 11:13
  • @Sinatr I have only One ComboBox. This single combobox has single selectable items and also the GroupSlectionItems. – Santhosh Rajoo Mar 15 '17 at 11:22
  • @MaKCbIMKo: I mean that instead of clicking each single selection items A,B,C i want the user the privilege to select a Group(M) so it would display all rows related to A,B,C in addition to the single selection itemm – Santhosh Rajoo Mar 15 '17 at 11:24
  • `privilege to select a Group(M) so it would display all rows related to A,B,C` - display where? – MaKCbIMKo Mar 15 '17 at 11:33
  • Please find the screen shot i created and added here. Maybe that would help. – Santhosh Rajoo Mar 15 '17 at 11:58
  • It seems you want to use group headers as items and show them first. That's easy, just [use dictionary](http://stackoverflow.com/q/1605845/1997232). The dictionary should contain entries for all values (single options) and all groups (grouping elements) and their corresponding string presentation. – Sinatr Mar 15 '17 at 12:20

0 Answers0