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

Rad Grid in content pages javascript

3 Answers 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
kollam2003
Top achievements
Rank 1
kollam2003 asked on 29 Mar 2009, 05:02 AM
I'm uisng a javasrcipt to check if there are any selected rows in the radgrid
<script type="text/javascript" language="javascript">
        function Confirm_ReAssign_RadGrid_AssignedChart() {
            var grid = window['<%= RadGrid_AssignedChart.ClientID %>'];
            if (grid.MasterTableView.SelectedRows.length > 0) {
                var agree = confirm("Are you sure to ReAssign the selected record(s)?");
                if (agree)
                    return true;
                else
                    return false;

            }

            else {
                alert("Please select atleast one record"); return false;
            }
        }
    </script>

The grid is in the content page.
grid is showing null.
Plz help

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 30 Mar 2009, 06:17 AM
Hi,

I am not sure where you are trying the above given Javascript code. You must try the code in the aspx of the Content page. Also if you are using an RadControls for asp.net ajax you must access the Grid as shown below.

JS:
 
 var grid = $find("<%=RadGrid1.ClientID %>");   
 


Shinu.
0
kollam2003
Top achievements
Rank 1
answered on 30 Mar 2009, 09:28 AM
I'm using the RAD controls for Ajax
The javascript is in the content page itself
Now I'm getting the error:
          Error: grid.MasterTableView.SelectedRows is undefined

0
kollam2003
Top achievements
Rank 1
answered on 17 Apr 2009, 08:57 AM
any other options?
Tags
Grid
Asked by
kollam2003
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
kollam2003
Top achievements
Rank 1
Share this question
or