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

How to prevent a cell from entering edit mode?

1 Answer 34 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Henri
Top achievements
Rank 1
Henri asked on 21 Apr 2011, 02:21 PM
Hi,

I defined a GridViewDataColumn with a CellTemplate (with TextBlock) and a CellEditTemplate (with TextBox).
Depending on the data, Edit is allowed or not.
How can I prevent a cell from switching to edit mode, when edit is not allowed?
Setting the TextBox to ReadOnly, does not prevent the switch to edit mode.

Best regards,

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 21 Apr 2011, 02:25 PM
Hi,

 You can use IsReadOnly column property to achieve your goal. Other possible approach will be to load different templates for the edit mode using CellEditTemplateSelector similar to this demo

All the best,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Henri
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or