Hi,
I have a radcombobox with items which are filled by my own routine.
In the combobox there is a context menu with two options:
- Check all
- Uncheck all
When I select one of the above I want to itterate trough the items and set the checkbox to true or false. I call my routine and I see that the Entitype.IsChecked is set but the checkbox in the combobox isn't updated?
The code behind is:
I hope someone can help me with this.
I have a radcombobox with items which are filled by my own routine.
In the combobox there is a context menu with two options:
- Check all
- Uncheck all
When I select one of the above I want to itterate trough the items and set the checkbox to true or false. I call my routine and I see that the Entitype.IsChecked is set but the checkbox in the combobox isn't updated?
<
telerikInput:RadComboBox
x:Name
=
"Tra_EntityTypeList"
Width
=
"150"
Height
=
"25"
HorizontalAlignment
=
"Left"
Tag
=
"EntityList"
ClearSelectionButtonContent
=
"None"
IsEnabled
=
"True"
FontStyle
=
"Italic"
EmptyText
=
"Selection"
MaxDropDownHeight
=
"225"
DropDownClosed
=
"ItemsChecked"
>
<
telerikInput:RadComboBox.ItemTemplate
>
<
DataTemplate
x:Name
=
"EntityTemplate"
>
<
Grid
Margin
=
"0"
Width
=
"200"
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"25"
/>
<
ColumnDefinition
Width
=
"175"
/>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
<
RowDefinition
/>
</
Grid.RowDefinitions
>
<
CheckBox
Grid.Column
=
"0"
Margin
=
"0"
Name
=
"CheckBoxForEntityType"
IsChecked
=
"{Binding IsChecked, Mode=TwoWay}"
/>
<
TextBlock
Grid.Row
=
"0"
Grid.Column
=
"1"
Text
=
"{Binding Description}"
Tag
=
"EntityType"
>
<!--Context menu-->
<
telerik:RadContextMenu.ContextMenu
>
<
telerik:RadContextMenu
Opened
=
"RadContextMenu_Opened"
ItemClick
=
"RadContextMenu_ItemClick"
>
<
telerik:RadContextMenu.Items
>
<
telerik:RadMenuItem
Header
=
"Select all"
Tag
=
"EntSelectAll"
/>
<
telerik:RadMenuItem
Header
=
"Select none"
Tag
=
"EntSelectNone"
/>
</
telerik:RadContextMenu.Items
>
</
telerik:RadContextMenu
>
</
telerik:RadContextMenu.ContextMenu
>
</
TextBlock
>
</
Grid
>
</
DataTemplate
>
</
telerikInput:RadComboBox.ItemTemplate
>
</
telerikInput:RadComboBox
>
The code behind is:
switch (_Type)
{
case "EntityType":
int i = 0;
foreach (EntityType MySelectedEntityType in Tra_EntityTypeList.Items)
{
MySelectedEntityType.IsChecked = true;
i++;
}
break;
}
I hope someone can help me with this.