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

Batch Editing - Readonly Row

7 Answers 137 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.
venky
Top achievements
Rank 1
venky asked on 22 Jul 2011, 11:23 AM
I am using the grid in Batch editing mode with AJAX binding. How can I make a particular row in the grid readonly depending on a value in one of the columns on that row. Thank you in advance.

7 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 25 Jul 2011, 07:51 AM
Hello Venky,

Unfortunately, this is currently not supported.

Regards,
Rosen
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
venky
Top achievements
Rank 1
answered on 26 Jul 2011, 02:07 AM
Is this supported in any other mode like InForm/InLine grid editing? Thanks.
0
Rosen
Telerik team
answered on 26 Jul 2011, 06:57 AM
Hello Venky,

I'm afraid not, however you may consider hiding the command buttons for rows which should not be editable. This can be achieved by hooking to the rowDataBound client event:

function rowDataBound(e) {
   if (e.dataItem.MyField == "SomeValue") {
      $(e.row).find(".t-grid-edit, .t-grid-delete").hide();
   }
}

Regards,
Rosen
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
venky
Top achievements
Rank 1
answered on 30 Jul 2011, 08:24 PM
Thanks Rosen. How do I make the entire grid uneditable for some users and editable for some?
0
Rosen
Telerik team
answered on 01 Aug 2011, 07:42 AM
Hello Venky,

You may set Editable's Enable options to either true or false. 

.Editable(editing => editing.Enabled(Model.UserCanEdit))

Best wishes,
Rosen
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
venky
Top achievements
Rank 1
answered on 01 Aug 2011, 01:06 PM
Hello Rosen,
That was the first thing I tried but it did not work for me.

.Editable(e => e.Enabled(false)
                       .Mode(GridEditMode.InLine))

columns.Command(c => c.Edit());

.DataBinding(d => d.Ajax()
                            .Select()
                            .Update("Update", "XXX")
                    )


Still shows the edit button and calls the controller Update button when pressed "Update".
Am I missing anything here?
Thanks, Venky
0
Rosen
Telerik team
answered on 01 Aug 2011, 04:41 PM
Hello Venky,

 In order to hide command column you may use its Visible property.

Best wishes,
Rosen
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
Grid
Asked by
venky
Top achievements
Rank 1
Answers by
Rosen
Telerik team
venky
Top achievements
Rank 1
Share this question
or