Using VS2010 ASP.NET 11.2 controls.
I'm trying to figure out how to do the client side scripting stuff.
I'm able to wire up a button click event to some javascript.
Seems like I can get access to the WebHierarchicalDataGrid, it is not null.
Several postings talked about getting access to the gridView so they can then find the active cell and then the active row. I'm hoping to set the value in a cell this way.
When I try to get the gridView I get an exception "Object doesn't support property of method get_gridView".
<script language="javascript" type="text/javascript">
function DeactivateNow() {
var grid = document.getElementById("MainContent_WebHierarchicalDataGrid1");
var gridView = grid.get_gridView(); //.get_behaviors().get_activation().get_activeCell().get_row();
alert("Deactivated");
}
</script>
Any idea of why this does not work for me??
Thanks,
Brian.
Hello demoend ,
Thank you fo posting in our forum.
You can get the grid element with the $find(“gridId”) method and from there you have access to the get_GridView and other methods native to the grid. For example:
function BtnClick() {
var grid = $find("WebHierarchicalDataGrid1");
var activeRow = grid.get_gridView().get_behaviors().get_activation().get_activeCell().get_row();
Let me know if you have any further questions or concerns regarding this.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://ko.infragistics.com/support
Maya,
OK, so now I can access the gridView, thanks!
However, I'm not able to get the cell of the button I just clicked on.
In the behaviors of the grid I have the Activation turned on and the Selection turned on.
When I click on the button the whole row is selected, the client side javascript is called.
I am able to access the activation object when I call the get_activation(). However, if I then try to get the active cell via the code below, it is null.
var activeCell = grid.get_gridView().get_behaviors().get_activation().get_activeCell();
Is there something else I need to enable?