Click here to Skip to main content
11,645,499 members (73,667 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Windows XAML WPF , +
Dear Experts,

In my WPF project we are using WPF Extended toolkit version 1.8.0

Here i have taken CheckComboBox in XAML Like Below

<xctk:checkcombobox height="20" name="LocaleSelector"                              Margin="226,12,26,429" ItemSelectionChanged="LocaleSelector_ItemSelectionChanged"> </xctk:checkcombobox>

Then in my code view we are binding with the database.
public void BindComboBox()
        {
            try
 
            {
                SqlConnection conn = new SqlConnection(str);
                SqlDataAdapter da = new SqlDataAdapter("select Department_Name from Dept", conn);
                DataSet ds = new DataSet();
                da.Fill(ds, "dept");
                Selector sel = new Selector();
                LocaleSelector.Items.Add("All");
               if (ds.Tables["dept"].Rows.Count > 0)
                {
                    foreach (DataRow dr in ds.Tables["dept"].Rows)
                    {
                     LocaleSelector.Items.Add(dr["Department_Name"]);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
This code is working fine. but we need that when user selects All from the checkcombobox then we want disable or make readonly or something else for remaining items from the checkcombobox and vice-versa.

Please provide me your valuble ideas to implement this.
Posted 23-Jan-13 18:50pm
D-Kishore4.1K
Edited 24-Feb-13 17:30pm
v12
Comments
Thomas Duwe at 29-Jan-13 3:11am
   
How about listening to the Selected/Unselected event of the CheckComboBox and if the 'All' item is selected(checked), then
set IsEnabled=false for all other items and optionally remove all other items from the SelectedItems property of the CheckComboBox.
That's really not the best way but it should work.
Matt T Heffron at 11-Feb-13 13:39pm
   
It might be easier, both for you AND for the user, if, instead of having the All selection disable everything else in the list, just have everything else in the list unselect All.

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

  Print Answers RSS
0 jyo.net 814
1 OriginalGriff 710
2 Sergey Alexandrovich Kryukov 458
3 CPallini 426
4 Afzaal Ahmad Zeeshan 418
0 OriginalGriff 1,065
1 Sergey Alexandrovich Kryukov 703
2 Afzaal Ahmad Zeeshan 702
3 DamithSL 681
4 CPallini 595


Advertise | Privacy | Mobile
Web04 | 2.8.150731.1 | Last Updated 24 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100