This question is locked. New answers and comments are not allowed.
This has to be something simple I'm missing.
I have a UserControl with a Telerik RadGridView:
In my code-behind this works:
Me.MerchandiseGridView.Columns(0).IsVisible = True
In my code-behind this DOES NOT work (get instance not set error):
Me.MerchandiseSelectColumn.IsVisible = True
SL5 project .NET 4.0
Any suggestions why this doesn't work?
Thanks, Rob.
I have a UserControl with a Telerik RadGridView:
<
telerik:RadGridView
x:Name
=
"MerchandiseGridView"
Margin
=
"0"
AreRowDetailsFrozen
=
"True"
AutoGenerateColumns
=
"False"
CanUserFreezeColumns
=
"False"
CanUserReorderColumns
=
"False"
CanUserResizeColumns
=
"False"
CanUserSortColumns
=
"False"
RowIndicatorVisibility
=
"Collapsed"
DataContext
=
"{Binding Source={StaticResource MerchandiseData}}"
ItemsSource
=
"{Binding Collection}"
ShowGroupPanel
=
"False"
IsReadOnly
=
"False"
IsFilteringAllowed
=
"True"
>
<
telerik:RadGridView.Columns
>
<!-- (0) Merchandise ID -->
<
telerik:GridViewDataColumn
x:Name
=
"MerchandiseIDColumn"
Header
=
"MerchandiseID"
IsVisible
=
"False"
DataMemberBinding
=
"{Binding MerchandiseIDID}"
/>
<!-- (1) Select for Merchandise Returns -->
<
telerik:GridViewDataColumn
x:Name
=
"MerchandiseSelectColumn"
Header
=
""
DataMemberBinding
=
"{Binding Selected}"
IsReadOnly
=
"True"
IsVisible
=
"False"
>
<
telerik:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
CheckBox
IsChecked
=
"{Binding Selected, Mode=TwoWay}"
/>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellTemplate
>
</
telerik:GridViewDataColumn
>
<!-- (2) Type of Merchandise -->
<
telerik:GridViewDataColumn
x:Name
=
"MerchandiseTypeColumn"
Header
=
"Type"
IsReadOnly
=
"True"
Width
=
"110"
DataMemberBinding
=
"{Binding Type}"
/>
<!-- (3) Item -->
<
telerik:GridViewDataColumn
x:Name
=
"MerchandiseItemColumn"
Header
=
"Item"
IsReadOnly
=
"True"
Width
=
"190"
DataMemberBinding
=
"{Binding Item}"
/>
<!-- (4) Part Number -->
<
telerik:GridViewDataColumn
x:Name
=
"MerchandisePartNoColumn"
Header
=
"Part No."
IsReadOnly
=
"True"
Width
=
"100"
IsVisible
=
"True"
DataMemberBinding
=
"{Binding PartNumber}"
/>
<!-- (5) Price -->
<
telerik:GridViewDataColumn
x:Name
=
"MerchandisePriceColumn"
Header
=
"Price"
IsReadOnly
=
"True"
Width
=
"70"
DataMemberBinding
=
"{Binding Price}"
TextAlignment
=
"Right"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
In my code-behind this works:
Me.MerchandiseGridView.Columns(0).IsVisible = True
In my code-behind this DOES NOT work (get instance not set error):
Me.MerchandiseSelectColumn.IsVisible = True
SL5 project .NET 4.0
Any suggestions why this doesn't work?
Thanks, Rob.