Hi all,
I am new to the grid control and am trying to understand how to setup and use the control to fulfill my requirements. I have a grid that has 3 columns. The grid has the CellEditing behavior setup where two of the columns use Dropdown EditorProviders. My 3rd column contains a boolean value that also needs to be editable.
I created a TemplateDataField that contains a checkbox. The checkbox is disabled when the grid loads and I would like to enable it when the row is made editable. I am trying to use the EnteringEditMode event to do this, but I can't seem to get my javascript function to work correctly.
<script language="javascript" type="text/javascript">
function activateTemplateControls()
{
var grid = $find("<%= WebDataGrid1.ClientID %>");
// Get active row
var activeRow = grid.get_behaviors().get_activation().get_activeCell().get_row();
}
</script>
I receive an error: 'get_behaviors().get_activation()' is null or not an object.
What am I doing wrong? Am I using the wrong event is there a better way of doing this? Also, is there a check box editor provider?
Thanks
Hey,
First I'll check that you are using the WebDataGrid (for flat data) and not the new WebHierarchicalDataGrid. Assuming the former, var activation = grid.get_behaviors().get_activation() is correct. If you were to use the hierarchical one, you'd need var activation = grid.get_gridView().get_behaviors().get_activation()
Now, do you have activation in your behaviors collection and turned on? One of those must be false for you to get null returned. If you can't get it, attach your grid definition here.
And to answer your last question, there is no available check box editor provider currently. You could implement your own if you desired. Another option would be to listen to the changed event of the checkbox and use that to set the value of the cell.
regards,David Young
David,
Thanks for the reply. I hadn't turned on the activation behavior.
I turned it on and it worked.
Thanks,
Jennifer