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

Different editors for insert and edit

6 Answers 78 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.
Victor
Top achievements
Rank 1
Victor asked on 02 Dec 2010, 03:40 PM
Hi!

We are using the grid component successfully, but have a some pages where we want users to be able to edit _some_ of the fields after addition (the others should be read only). For example for one class we have multiple properties, but only want the user to be able to edit the name once created. How would you suggest solving this problem?


Thank you

/Victor

6 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 02 Dec 2010, 05:10 PM
Hello Victor,

 If you are using ajax editing you can hook up to the OnEdit client-side event and hide/disable the html elements which are not needed. The event args of the OnEdit event expose a field which tells what the current mode is - edit or insert.

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
Victor
Top achievements
Rank 1
answered on 03 Dec 2010, 08:00 AM
Hi!
That's actually quite nice of an idea... Since we use server-side events as fallback, are there any ways to achieve similair results there? I suppose we could do a custom editor template with branching based on some viewmodel variable, but we are kind of hoping there is a more straight-forward way.

Thanks
/Victor
0
Accepted
Atanas Korchev
Telerik team
answered on 03 Dec 2010, 08:17 AM
Hi Victor,

 Currently branching in the editor template is the only option for server binding.  Perhaps you can check if the Model value is default (null or some other value) to determine whether in insert or edit mode. Or check the query string for the Grid-mode parameter (which kind of violates the MVC paradigm but will work 100%).

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
Michael
Top achievements
Rank 1
answered on 04 Apr 2011, 02:33 PM
Sorry to "drop in" on this thread, but i was about to ask the same question.

Im afraid the "hook on to" comment requires a little more explanation for this bear??

with thanks

Michael
0
Atanas Korchev
Telerik team
answered on 04 Apr 2011, 03:28 PM
Hi Michael,

Could you please clarify what needs further explanation? Handling the OnEdit event should be straightforward. The linked help topic shows a sample implementation.

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
Michael
Top achievements
Rank 1
answered on 05 Apr 2011, 05:05 AM
missed the link...sorry
Tags
Grid
Asked by
Victor
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Victor
Top achievements
Rank 1
Michael
Top achievements
Rank 1
Share this question
or