All,
I have seen this issue reported by other people, but I have never had an issue. Now, it seems, I do. I've tried just about everything I know to resolve it, but while I find the gird on the page, the method get_masterTableView() always returns null.
My scenario involves my wanting to asynchronously load many grids on a page. Loading them normally has been pretty slow, so I am looking at faster ways to get the page up. As grid data populates, the grid shows up. Here is one of my Grid definitions:
Here is the script
The script, as I said, finds the grid just fine, but the methods in the object do not include the get_masterTableView().
Thanks for any insight!
Sean~
I have seen this issue reported by other people, but I have never had an issue. Now, it seems, I do. I've tried just about everything I know to resolve it, but while I find the gird on the page, the method get_masterTableView() always returns null.
My scenario involves my wanting to asynchronously load many grids on a page. Loading them normally has been pretty slow, so I am looking at faster ways to get the page up. As grid data populates, the grid shows up. Here is one of my Grid definitions:
<telerik:RadGrid ID="MyAnimalCategories" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" AutoGenerateEditColumn="False" CellSpacing="0" GridLines="None" OnNeedDataSource="MyAnimalCategoriesNeedDataSource" PageSize="20" OnSelectedIndexChanged="MyAnimalCategoriesSelectedIndexChanged"> <ClientSettings EnablePostBackOnRowClick="true"> <Selecting AllowRowSelect="true" /> <ClientEvents OnRowSelected="SetDeviceText" OnCommand="function(){}" /> </ClientSettings> <MasterTableView ShowHeadersWhenNoRecords="true" ClientDataKeyNames="AnimalCategoryId" DataKeyNames="AnimalCategoryId" TableLayout="Fixed"> <Columns> <telerik:GridBoundColumn DataField="AnimalCategoryName" HeaderText="Animal Species" UniqueName="Category"> <ItemStyle Wrap="false" /> <HeaderStyle Wrap="false" /> </telerik:GridBoundColumn> <telerik:GridTemplateColumn ItemStyle-Width="50px" AllowFiltering="false" ReadOnly="true" HeaderText="Status"> <ItemTemplate> <%# Convert.ToBoolean(Eval("IsActive").ToString())? "Active":"Inactive" %> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> </telerik:RadGrid>Here is the script
<telerik:RadCodeBlock runat="server" ID="RadCodeBlock1"> <script type="text/javascript"> function pageLoad(src, args) { var trainer = $('#<%= hdnTrainer.ClientID %>'); var trainerId = trainer.val(); PageMethod("LoadMySpecies", ["trainerId", trainerId], MySpecies, AjaxFailed); PageMethod("LoadMySubmissions", [], MySubmissions, AjaxFailed); } function PageMethod(fn, paramArray, successFn, errorFn) { var pagePath = window.location.pathname; //Create list of parameters in the form : {"paramName1":"paramValue1","paramName2":"paramValue2"} var paramList = ''; if (paramArray.length > 0) { for (var i = 0; i < paramArray.length; i += 2) { if (paramList.length > 0) paramList += ','; paramList += '"' + paramArray[i] + '":"' + paramArray[i + 1] + '"'; } } paramList = '{' + paramList + '}'; //Call the page method $.ajax({ type: "POST", url: pagePath + "/" + fn, contentType: "application/json; charset=utf-8", data: paramList, dataType: "json", success: successFn, error: errorFn }); } function MySubmissions(result) { var grid = $find("<%= MySubmissions.ClientID %>"); var masterTable = grid.get_masterTableView(); var data = eval(result.d); masterTable.set_dataSource(data); masterTable.dataBind(); } function MySpecies(result) { var grid = $find('<%= MyAnimalCategories.ClientID %>'); var masterTable = grid.get_masterTableView(); var data = eval(result.d); masterTable.set_dataSource(data); masterTable.dataBind(); } function AjaxFailed(result) { alert(result.statusText); } </script></telerik:RadCodeBlock>The script, as I said, finds the grid just fine, but the methods in the object do not include the get_masterTableView().
Thanks for any insight!
Sean~