Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
895
How do I get the gridView in javaScript?
posted

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.

Parents
No Data
Reply
  • 29417
    Offline posted

    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

     

Children