Hello, guys.
I have a grid and I need to select/deselect rows progammatically in javascript depending on some operations (This is already done).
Now, I need to prevent user on selecting/deselecting rows by clicking. Im creating the grid completelly in my code behind and this is how I'm trying to achieve this behavior with no success:
VB
With
GridListaItm.ClientSettings
.AllowKeyboardNavigation =
False
.AllowColumnsReorder =
False
.EnablePostBackOnRowClick =
False
.EnableRowHoverStyle =
True
.Selecting.AllowRowSelect =
True
.Selecting.EnableDragToSelectRows =
False
.Resizing.AllowColumnResize =
True
.Resizing.AllowResizeToFit =
True
.Scrolling.AllowScroll =
True
.Scrolling.UseStaticHeaders =
True
.Scrolling.SaveScrollPosition =
True
.Scrolling.FrozenColumnsCount = 3
.ClientEvents.OnRowSelecting =
"RowSelecting"
.ClientEvents.OnRowSelecting =
"RowSelecting"
.ClientEvents.OnRowClick =
"RClic"
End
With
JS
<script type=
"text/javascript"
>
var
snClic=0;
var
snCambio=0;
function
RowSelecting(sender, eventArgs) {
if
(snCambio == 1) { snCambio = 0;
return
0;}
if
(snClic == 1) { eventArgs.set_cancel(
true
); snCambio = 1; snClic = 0;}
}
function
RClic(sender, eventArgs) {
snClic = 1;
snCambio = 0;
}
</script>