Greeting,
I am currently working on an MVVM application using a Radgridview to present information to the user. The data I have to present is in the form of a table (2D array) that I load from .CSV file. Since the number of column changes depending on the loaded file, I use a DataTable and then bind it to my RadGridView with AutoGeneratingColumn. Up to there everything works fine. The problem I have is that there is 2 columns in the DataTable that are always present and that I want to bind to a preexisting column inside the grid. As you can see in the following code snippet, my 2 columns are called IsUsed (a boolean) and Status (also a bool)
<
telerik:GridViewCheckBoxColumn
Name
=
"colTest"
AutoSelectOnEdit
=
"True"
DataMemberBinding
=
"{Binding IsUsed, Mode=TwoWay}"
EditTriggers
=
"CellClick"
>
<
telerik:GridViewCheckBoxColumn.EditorStyle
>
<
Style
BasedOn
=
"{StaticResource GridViewCheckBoxStyle}"
TargetType
=
"telerik:GridViewCheckBox"
>
<
Setter
Property
=
"Background"
Value
=
"{Binding Status, Converter={StaticResource BooltoColorConverter}}"
/>
</
Style
>
</
telerik:GridViewCheckBoxColumn.EditorStyle
>
</
telerik:GridViewCheckBoxColumn
>
Currently the columns are auto generated and the predefined binding does not work. Is there a way to do this binding? I tried intercepting the AutoGenerating event but I don't know what to do from there.
Thank you and have a great day!