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

[Solved] Individual row cell readonly runtime

2 Answers 156 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.
Aaron Hanusa
Top achievements
Rank 1
Aaron Hanusa asked on 16 Sep 2010, 08:47 PM
I would like each row to determine whether a cell is readonly or not at runtime, based on a property of the underlying bound object. 

Currently, the only way I can get this to work is by doing the following:

object boundObject = e.DataElement;
if (boundObject.SomeProperty == "xyz")
   e.Row.Cells[4].IsEnabled = false;

I'd rather make the Cell ReadOnly, however, it does not expose an IsReadonly property. 

Is there a way to do this?

Thanks!

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 17 Sep 2010, 06:30 AM
Hello,

 Why not load different templates conditionally using the approach demonstrated on this demo?

Best wishes,
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
0
Tyree
Top achievements
Rank 2
answered on 17 Sep 2010, 08:26 PM
Aaron, do a search in this forum for "readonly rows and cells". Read the first thread results...bottom of thread.
Tags
GridView
Asked by
Aaron Hanusa
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Tyree
Top achievements
Rank 2
Share this question
or