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
235
Get selected row on button click
posted

How do I get the selected row on the WebDataGrid on a button click, client side?

Parents
No Data
Reply
  • 37874
    posted

    Hi khoke,

    You could do this using javascript code, similar to the following:

            function buttonClicked() {

                var grid = $find("WebDataGrid1");

                //Gets the selected row

                var selectedRow = grid.get_behaviors().get_selection().get_selectedRows(0);

                //Gets the text from the first cell of the selected row

                var firstCell = selectedRow.getItem(0).get_cell(0).get_text();

                alert(firstCell);

            }

    If you have any further questions, please feel free to contact me.

     

     

Children