Friday, 18 November 2011

access the radgrid's control on client

 You can access ItemTemplate's control on client side using below JS.

JS code 


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

                if (grid) {
                    var MasterTable = grid.get_masterTableView();
                    var Rows = MasterTable.get_dataItems();
                    for (var i = 0; i < Rows.length; i++) {
                        var row = Rows[i];
                        var RadNumericTextBox1 = row.findControl("RadNumericTextBox1");
                        var childTable = row.get_nestedViews();
                        if (childTable) {
                            var childItems = childTable[0].get_dataItems();
                            for (var j = 0; j < childItems.length; j++) {
                                var childRow = childItems[j];
                                var CheckBox1 = $(childRow.get_element()).find("input[id*='CheckBox1']");
                            }
                        }
                    }
                 }
DOWNLOAD DEMO  OR VIEW THIS ARTICLE IN TELERIK 



No comments:

Post a Comment