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

How can i show a column in normal mode, but not in edit/insert mode?

4 Answers 48 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kyle Pike
Top achievements
Rank 1
Kyle Pike asked on 08 Nov 2010, 10:45 PM
Hi guys. I asked this in another thread but since it was marked answered, thought I'd ask again.

How do i display a column in normal mode, and NOT display it in edit mode or Insert Mode?

Is there a data annotation i can use to make this work? Or a simple column property?

in my Insert method i call a sproc that does not require input in these two fields.

this is a pretty common request for us here, and I'd like to not have to make a custom editor template / new type for each. Thanks in advance for your reply.

4 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 09 Nov 2010, 08:10 AM
Hi Kyle Pike,

 Try the ReadOnly setting:

columns.Bound(c => c.Something).ReadOnly(true)

Regards,
Atanas Korchev
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
Kyle Pike
Top achievements
Rank 1
answered on 09 Nov 2010, 03:21 PM
yes, that worked! It's a shame that it's not really included in any of the demos or how-tos.

now i have a different problem, same grid.  when i first load the grid, it displays the Type string "General" properly.

After inserting a record via the grid inline insert, it displays the following (see attachment) [Object object]

I have set a breakpoint and confirmed that comment type's type is being set properly. what am i doing wrong?

it also appears that line 2 of the display template is not hit when the grid is in this mode. Please advise.


0
Accepted
Atanas Korchev
Telerik team
answered on 09 Nov 2010, 04:11 PM
Hello Kyle Pike,

 Display templates work only during server binding. This is highlighted in our documentation. Use a client template instead:

Regards,

Atanas Korchev
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
Kyle Pike
Top achievements
Rank 1
answered on 09 Nov 2010, 04:16 PM
Ah, i hadn't realized i changed it to ajax binding. thank you.
Tags
Grid
Asked by
Kyle Pike
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Kyle Pike
Top achievements
Rank 1
Share this question
or