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

How to specified cell ReadOnly?

2 Answers 779 Views
GridView
This is a migrated thread and some comments may be shown as answers.
runer
Top achievements
Rank 1
runer asked on 30 Mar 2018, 08:00 AM

Have several type of data bound to RadGridView.ItemsSourceProperty, and target cell is in a Not ReadOnly column, how to make cell ReadOnly when DataItem is specified type?

The effect I want is make a column Editable except some cell with specified data type bound to that row, prevent these cell enter EditMode.

I have tried CellStyleSelector, but didn't find IsReadOnly DependencyProperty in GridViewCell.

Also tried using same Template in CellTemplateSelector for CellEditTemplateSelector, but these is no such CellEditStyleSelector, so the cell looks different when enter edit mode.

Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Vladimir Stoyanov
Telerik team
answered on 02 Apr 2018, 03:56 PM
Hello,

Please check out the IsReadOnlyBinding property of the GridViewDataColumn. It allows for some cells in a column to be readonly depending on a property of your business objects. For an example implementation, you can check out the ReadOnlyBinding SDK example.

Hope this helps.

Regards,
Vladimir Stoyanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
runer
Top achievements
Rank 1
answered on 08 Apr 2018, 09:30 AM
Thanks a lot.
Tags
GridView
Asked by
runer
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
runer
Top achievements
Rank 1
Share this question
or