The items that you bound the ComboBox to should have a property like IsSelected then you should bind IsChecked of the data-template CheckBox to that. Then you just need to iterate over the source collection and set IsSelected=true on all items.
Up vote 0 down vote favorite share g+ share fb share tw.
I have on checkbox inside telerik combo control. If User click on "All" option from checkbox list then I want select all checkboxs. Checkbox values.
My Sample code is below. Private void chkWeeks_Checked(object sender, RoutedEventArgs e) { //Here I want code for selecting all checkboxes. } wpf link|improve this question edited Feb 23 at 13:19H.B.43k61645 asked Feb 23 at 13:12Anil Limbani11.
Read the editing help. – H.B. Feb 23 at 13:16.
The items that you bound the ComboBox to should have a property like IsSelected, then you should bind IsChecked of the data-template CheckBox to that. Then you just need to iterate over the source collection and set IsSelected=true on all items. E.g.
Public class MyClass : MyBaseClass // Whatever you may have called it, { public bool IsSelected { ... } public string DaysText { ... } //... } //In the handler that is supposed to select all foreach (var item in MonthDaysList) item. IsSelected = true; Of course the property needs to have change notifications. (Also a note on usability: I do not thing that ComboBoxes should contain CheckBoxes, if you need multiple item selection use a ListBox).
I had bounded checkbox to combobox and combobox has property IsSelected. – Anil Limbani Feb 23 at 13:22 @user1228382: I am talking about the bound items. – H.B. Feb 23 at 13:22 I am new to wpf so I cant get your point.
Sorry but can you clarify it little more. – Anil Limbani Feb 23 at 13:26 @user1228382: Added an example... – H.B. Feb 23 at 13:26.
You need to take one more property isSelected as said by H.B. add IsChecked="{Binding IsSelected}" to CheckBox tag in xaml file. Create one property in the appropriate class i.e. Public bool isSeleted....... When you get in to event chkWeeks_Checked() in this function get reference of the ComboBox item source like objList = (TypeCastYourClassType)YourComboBox.
ItemSource;... Now the objList contains all checkbox items. Iterate through objList collection and get isSeleted property for each and every single item and that's done.... In your case MonthDayList = (TypeCastYourClassType)rcbDays. ItemSource; for(int i=0;i Count;i++) { MonthDayListi.
IsSelected = true; }.
Thank You Sir..... – Anil Limbani Feb 24 at 8:01.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.