or
<
telerik:RadGridView
Grid.Row
=
"1"
Grid.Column
=
"0"
HorizontalAlignment
=
"Stretch"
Margin
=
"0,0,0,0"
CanUserDeleteRows
=
"False"
CanUserInsertRows
=
"False"
IsReadOnly
=
"True"
IsFilteringAllowed
=
"True"
ColumnWidth
=
"*"
SelectionMode
=
"Multiple"
SelectionUnit
=
"FullRow"
AutoGenerateColumns
=
"True"
GroupRenderMode
=
"Flat"
AutoExpandGroups
=
"True"
IsSynchronizedWithCurrentItem
=
"True"
x:Name
=
"GeotechGrid"
ItemsSource
=
"{Binding Path=ReportsToDisplay, Mode=OneWay}"
SelectedItem
=
"{Binding Path=SelectedReport, Mode=TwoWay}"
>
<
telerik:RadGridView.Columns
/>
</
telerik:RadGridView
>
<
ListBox
ItemsSource
=
"{Binding Columns, ElementName=GeotechGrid}"
x:Name
=
"GeotechHideColListbox"
>
<
ListBox.ItemTemplate
>
<
DataTemplate
>
<
CheckBox
Content
=
"{Binding Header}"
IsChecked
=
"{Binding IsVisible, Mode=TwoWay}"
/>
</
DataTemplate
>
</
ListBox.ItemTemplate
>
</
ListBox
>
private void RetrieveSetupParameters()
{
foreach(GeotechSetup x in this.context.GeotechSetups.ToList())
{
// 1) x.Fieldname is the name of the field in the GeotechReport table
// 2) x.FieldHeader is what I want to be the column header text
// 3) x.FieldVisibility is what I want to use to set the listbox items
// and hide the columns I specify in the database
}
}