This question is locked. New answers and comments are not allowed.
Hi!
What I'm trying to accomplish is this:
I have a grid, that have many columns in it. When a property changes outside the grid from Open to Closed, this should affect the grid to make it ReadOnly. This is all fine, and it works great.
However, the Grid do contains a few standard GridViewDataColumns, and a few that contains a Data Template that contains a control. In the case where I use the controls, I set the control to readonly and it will be grayed out to make sure the user understands that the control is no longer usable, but the standard GridViewDataColumn won't do that for some reason. Is it somehow possible to accomplish this? See attachment if it's unclear.
What I'm trying to accomplish is this:
I have a grid, that have many columns in it. When a property changes outside the grid from Open to Closed, this should affect the grid to make it ReadOnly. This is all fine, and it works great.
However, the Grid do contains a few standard GridViewDataColumns, and a few that contains a Data Template that contains a control. In the case where I use the controls, I set the control to readonly and it will be grayed out to make sure the user understands that the control is no longer usable, but the standard GridViewDataColumn won't do that for some reason. Is it somehow possible to accomplish this? See attachment if it's unclear.
telerik:RadGridView IsReadOnly="{Binding IsReadOnly}" Name="TaskGrid" ShowGroupPanel="False" ItemsSource="{Binding TaskViewModels}" SelectedItem="{Binding SelectedTask, Mode=TwoWay}" AutoGenerateColumns="False"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn UniqueName="ProductCode" Width="150" DataMemberBinding="{Binding Task.ProductCode}" IsGroupable="False"> <telerik:GridViewDataColumn.Header> <Grid> <TextBlock Text="Delivery Item" TextWrapping="Wrap"/> </Grid> </telerik:GridViewDataColumn.Header> </telerik:GridViewDataColumn> <telerik:GridViewDataColumn UniqueName="Task.Description" Header="Description" IsGroupable="False" TextWrapping="Wrap" Width="250"> <telerik:GridViewDataColumn.CellTemplate> <DataTemplate> <TextBox AcceptsReturn="True" MinWidth="150" TextWrapping="Wrap" IsReadOnly="{Binding IsReadOnly}" Text="{Binding Task.Description, Mode=TwoWay}"/> </DataTemplate> </telerik:GridViewDataColumn.CellTemplate> </telerik:GridViewDataColumn> <telerik:GridViewDataColumn UniqueName="Date" DataMemberBinding="{Binding Task.Date}" Header="Date" IsGroupable="False" DataFormatString="{} {0: yyyy-MM-dd}" /> </telerik:RadGridView.Columns></telerik:RadGridView>public bool IsReadOnly{ get { if(ParentViewModel.Project != null) return ParentViewModel.Project.State == ProjectState.Closed; return false; }}