5 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 23 Mar 2011, 05:53 AM
Hello Jason,
You can try the following code snippet to disable row selection when grid is in edit mode.
ASPX:
C#:
Thanks,
Princy.
You can try the following code snippet to disable row selection when grid is in edit mode.
ASPX:
<
ClientSettings
Selecting-AllowRowSelect
=
"true"
EnablePostBackOnRowClick
=
"false"
>
<
ClientEvents
OnRowSelecting
=
"OnRowSelecting"
/>
</
ClientSettings
>
C#:
<script type=
"text/javascript"
>
function
OnRowSelecting(sender, args) {
var
editIndex = sender._editIndexes[0];
if
(editIndex > -1) {
args.set_cancel(
true
);
}
}
</script>
Thanks,
Princy.
0

Andrew
Top achievements
Rank 1
answered on 29 Oct 2012, 02:25 PM
What does ._editIndexes[0]; refer to in your code snipplet?
0

Princy
Top achievements
Rank 2
answered on 30 Oct 2012, 05:30 AM
Hi,
You can find which items are in edit mode using the _editIndexes array. It contains the indexes of those items. _editIndexes[0] will index of the first edit item.
Thanks,
Princy.
You can find which items are in edit mode using the _editIndexes array. It contains the indexes of those items. _editIndexes[0] will index of the first edit item.
Thanks,
Princy.
0

Andrew
Top achievements
Rank 1
answered on 30 Oct 2012, 12:13 PM
Thanks for the reply. But I do not see an event for OnRowSelecting that takes both sender and args. From the documentation on the site I only see OnRowSelect that takes an argument of e.
http://demos.telerik.com/aspnet-mvc/razor/grid/clientsideevents
When debugging I do not see _editIndexes[0] in the passed in argument. Any help is greatly appricated.
Baiscly, I need to determine if the row is in edit mode, because when a row is selected in the grid, an ajax event is fired. When the row is in edit mode, this event throws a server error.
Thanks,
Andrew
http://demos.telerik.com/aspnet-mvc/razor/grid/clientsideevents
When debugging I do not see _editIndexes[0] in the passed in argument. Any help is greatly appricated.
Baiscly, I need to determine if the row is in edit mode, because when a row is selected in the grid, an ajax event is fired. When the row is in edit mode, this event throws a server error.
Thanks,
Andrew
0

Princy
Top achievements
Rank 2
answered on 31 Oct 2012, 08:50 AM
Hi Andrew,
Please post the questions in Telerik MVC Extensions for getting details about ASP.NET MVC grid clientside events.
Thanks,
Princy.
Please post the questions in Telerik MVC Extensions for getting details about ASP.NET MVC grid clientside events.
Thanks,
Princy.