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

[Solved] Enable/Disable grid rows on client side

1 Answer 241 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Calvin Bowens
Top achievements
Rank 1
Calvin Bowens asked on 13 Jul 2009, 04:09 PM
Is there any way to enable/disable grid rows with client-side script?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 14 Jul 2009, 05:26 AM
Hi Calvin,

Try out the following code in order to disable the row from client side.

JavaScript:
 
<script type="text/javascript"
function RowSelected(sender, eventArgs) // Attach the function to OnRowSelected for disabling row on selecting 
    var row = eventArgs.get_gridDataItem(); // Get the row 
    row.get_element().disabled = true// Set as disabled 
function OnRowCreated() 
 
</script> 
Note: If you are using any control inside GridTemplateColumn, then you need to get reference to the control and explicitly disable it.

-Shinu.
Tags
Grid
Asked by
Calvin Bowens
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or