Hi everyone :)
I have the following situation:
In my GridView, I have a DataColumn with a CellEditTemplate.
In this CellEditTemplate, I need a DataTemplate with a RadDropDownButton, that has a ListBox (with checkboxes) as DropDownContent.
In code it looks like this:
This works correct. I can open the dropDownButton and get a List of Languages in it with checkboxes.
Now I don't have an idea, how to get the selected checkboxes as one string back in the field "LANGUAGES".
I want to have a string which seperate's the selected items with a comma.
Example:
x Language 1
Language 2
x Language 3
Now I want a string like "Language 1, Language 3". This should be written in the DataMember of the column.
Hope my explaination is clear.
How can I do this?
I have the following situation:
In my GridView, I have a DataColumn with a CellEditTemplate.
In this CellEditTemplate, I need a DataTemplate with a RadDropDownButton, that has a ListBox (with checkboxes) as DropDownContent.
In code it looks like this:
<UserControl.Resources> |
<DataTemplate x:Key="templateLanguagesItem"> |
<Grid> |
<CheckBox Name="chkLanguage" Content="{Binding LANGUAGENAME}" d:LayoutOverrides="Width, Height"/> |
</Grid> |
</DataTemplate> |
</UserControl.Resources> |
<telerik:RadGridView AutoGenerateColumns="False" HorizontalAlignment="Stretch" Margin="0,30,0,0" Name="grdBenutzer" VerticalAlignment="Stretch" ItemsSource="{Binding ElementName=UserDomainDataSource, Path=Data}"> |
<telerik:RadGridView.Columns> |
<telerik:GridViewDataColumn Header="Languages" DataMemberBinding="{Binding LANGUAGES, Mode=TwoWay}" Width="120"> |
<telerik:GridViewDataColumn.CellEditTemplate> |
<DataTemplate> |
<StackPanel> |
<telerik:RadDropDownButton Height="39" Content="Test" VerticalAlignment="Top"> |
<telerik:RadDropDownButton.DropDownContent> |
<ListBox Width="150" Height="200" ItemTemplate="{StaticResource templateLanguagesItem}" ItemsSource="{Binding Data, Source={StaticResource LanguageTestSource}}"/> |
</telerik:RadDropDownButton.DropDownContent> |
</telerik:RadDropDownButton> |
</StackPanel> |
</DataTemplate> |
</telerik:GridViewDataColumn.CellEditTemplate> |
</telerik:GridViewDataColumn> |
</telerik:RadGridView.Columns> |
</telerik:RadGridView> |
This works correct. I can open the dropDownButton and get a List of Languages in it with checkboxes.
Now I don't have an idea, how to get the selected checkboxes as one string back in the field "LANGUAGES".
I want to have a string which seperate's the selected items with a comma.
Example:
x Language 1
Language 2
x Language 3
Now I want a string like "Language 1, Language 3". This should be written in the DataMember of the column.
Hope my explaination is clear.
How can I do this?