This is a migrated thread and some comments may be shown as answers.

[Solved] Column IsReadOnly

3 Answers 148 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jack
Top achievements
Rank 1
Jack asked on 14 Jun 2009, 08:21 PM
Is this not a bindable property?  I get an ParserError trying to bind it to my BO

<telerikGridView:GridViewDataColumn UniqueName="IsNotApplicable" HeaderText="N/A" DataMemberPath="IsNotApplicable" IsReadOnly="{Binding Path=GuiAllowNotApplicable}"
                    <telerikGridView:GridViewDataColumn.CellTemplate> 
                        <DataTemplate> 
                            <TextBlock Text="N/A" Visibility="{Binding Converter={StaticResource ConvertBoolToVisibility}, Mode=OneWay, Path=IsNotApplicable}"/> 
                        </DataTemplate> 
                     </telerikGridView:GridViewDataColumn.CellTemplate> 
                    <telerikGridView:GridViewDataColumn.CellEditTemplate> 
                    <DataTemplate> 
                            <CheckBox Content="N/A" IsChecked="{Binding IsNotApplicable, Mode=TwoWay}" Visibility="{Binding Converter={StaticResource ConvertBoolToVisibility}, Mode=OneWay, Path=GuiAllowNotApplicable}"/> 
                        </DataTemplate> 
                    </telerikGridView:GridViewDataColumn.CellEditTemplate> 
                </telerikGridView:GridViewDataColumn> 

Basically I want to lock the user out of the cell unless my BO GuiAllowNotApplicable is True and then I will show my N/A CheckBox to modify the settings of BO.IsNotApplicable

Thanks

jack

3 Answers, 1 is accepted

Sort by
0
Stefan Dobrev
Telerik team
answered on 15 Jun 2009, 09:11 AM
Hi Jack,

GridViewDataColumn is a DependencyObject, which properties cannot be databound due to a limitation of the Silverlight platform. What you can do is to attach an event handler for PropertyChanged event of your business object and change IsReadOnly property of the column when GuiAllowNotApplicable property is changed.

Hope this helps.

Kind regards,
Stefan Dobrev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jack
Top achievements
Rank 1
answered on 15 Jun 2009, 02:41 PM
Stefan,

Thanks for the tip - more Silverlight fun and learning for me.  Okay so I can get the BO that changed via a collectionChanged event on my list BO but how do I go from the 'BO row' to the 'Grid Row' to set the column?

Also I need to disable the Cell, not the whole column - is that going to work?

Thanks

jack
0
Stefan Dobrev
Telerik team
answered on 17 Jun 2009, 08:39 AM
Hello Jack,

You can subscribe for BeginningEdit event of RadGridView and set GridViewBeginningEditRoutedEventArgs.Cancel property to true when you want to cancel the cell edit operation.

Best wishes,
Stefan Dobrev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Jack
Top achievements
Rank 1
Answers by
Stefan Dobrev
Telerik team
Jack
Top achievements
Rank 1
Share this question
or