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

Error On Page Load RadAjaxManager

2 Answers 82 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Hrushikesh Mokashi
Top achievements
Rank 1
Hrushikesh Mokashi asked on 24 Jul 2008, 08:11 AM
Hi All,

I am using  radgrid and radajaxmanager.
on page load it gives me error as

1>Microsoft JScript runtime error: 'Sys.WebForms.PageRequestManager' is null or not an object.

2>
I want client side row selection .Here i set the grid property but still it not allow me to select the row.

I bind the grid on page load.
The Code Are Folllows.

<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/CTX.master" CodeBehind="frmRepairOrder.aspx.vb" Inherits="CtraxENet2.frmRepairOrder"  Trace= "false" %>

 <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
   
<asp:Content ID="Content1" ContentPlaceHolderID="Content" runat="server">
       
   

<telerik:RadCodeBlock ID="radCodeBlock" runat="server" >
           
         <script type="text/javascript">
             function RowSelected(sender, args)
             {
                     
           
                        
                document.getElementById('<%=hFieldRowSelected.ClientID %>').value="true";
              
                document.getElementById('<%=hFieldSelectdRowValue.ClientID %>').value=args.getDataKeyValue("ro_number")+"#"+args.getDataKeyValue("branch");;
               
                 //
                 __doPostBack("Page","rGridRepairOrder");
             }
        </script>
       
        </telerik:RadCodeBlock>

 <telerik:RadAjaxManager ID="radAjaxManger1" runat="server" EnableAJAX="true">
    <AjaxSettings >
    <telerik:AjaxSetting AjaxControlID ="rGridRepair1" >
    <UpdatedControls >
    <telerik:AjaxUpdatedControl ControlID ="rGridRepair1" LoadingPanelID ="radLoadingPnl" />
    </UpdatedControls>
    </telerik:AjaxSetting>
    </AjaxSettings>
    </telerik:RadAjaxManager>
   
    <telerik:RadAjaxLoadingPanel ID="radLoadingPnl"  runat="server" BackColor="Control" Transparency="15" >
     <asp:Image ID="imgCustom1" runat="server"
                    ImageUrl="~/images/loadingFinal.gif" />
    </telerik:RadAjaxLoadingPanel> 



    <telerik:RadGrid id="rGridRepair1" LoadingTemplateTransparency="15"
              runat="server" allowsorting="True" ClientSettings-AllowKeyboardNavigation="true" 
                                skin="Outlook" AutoGenerateColumns="False" AllowPaging="True"
               GridLines="None"  Width="99.5%"
              Height="90px" ShowStatusBar="True" >
             
                <ClientSettings AllowKeyboardNavigation="True">
                    <Selecting AllowRowSelect="True" EnableDragToSelectRows="False" />
                    <ClientEvents  OnRowSelected="RowSelected" />
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                </ClientSettings>
               
              
                <PagerStyle Mode="NextPrevAndNumeric" Position="Top" />
                <HeaderStyle Height="20px" />
                <ItemStyle Height ="20px" />
                <MasterTableView EditMode="InPlace" GridLines="Both" DataKeyNames="branch,ro_number" ClientDataKeyNames="branch,ro_number" PageSize="2">
                    <RowIndicatorColumn Visible="False">                       
                        <HeaderStyle Width="20px" />
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn Visible="False" Resizable="False"
                        AutoPostBackOnFilter="True">                      
                        <HeaderStyle Width="20px" />
                    </ExpandCollapseColumn>
                    <Columns>                   
                   
                        <telerik:GridBoundColumn DataField="branch" HeaderText="Branch" UniqueName="Branch" ReadOnly="True" CurrentFilterFunction="IsNull" Display="False">
                            <HeaderStyle Width="100px" />
                            <ItemStyle Width="100px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="ro_number" Display="False" HeaderText="Repair Order Number"
                            UniqueName="ro_number" ReadOnly="True">
                            <HeaderStyle Width="100px" />
                            <ItemStyle Width="100px" />
                        </telerik:GridBoundColumn>
                       
                        <telerik:GridBoundColumn DataField="Cust_veh_fa" HeaderText="Vehicle Type" UniqueName="VehicleType" MaxLength="50">
                            <HeaderStyle Width="150px" />
                            <ItemStyle Width="150px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="reg" HeaderText="Vehicle Registration Number"
                            UniqueName="VehicleRegistrationNo" MaxLength="10">
                            <HeaderStyle Width="150px" />
                            <ItemStyle Width="150px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="stock_no" HeaderText="Stock Number" UniqueName="StockNumber">
                            <HeaderStyle Width="150px" />
                            <ItemStyle Width="150px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="driver" HeaderText="Driver Code" UniqueName="DriverCode">
                            <HeaderStyle Width="150px" />
                            <ItemStyle Width="150px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="charge_acct" HeaderText="Charge Account" UniqueName="ChargeAccount">
                            <HeaderStyle Width="250px" />
                            <ItemStyle Width="250px" />
                        </telerik:GridBoundColumn>
                       
                    </Columns>                   
                    <EditFormSettings>
                        <EditColumn UniqueName="EditCommandColumn1">
                        </EditColumn>
                    </EditFormSettings>
                   
                    <PagerStyle Mode="NextPrevAndNumeric" Position="Top" />
                   
                </MasterTableView>         
               
               
                <EditItemStyle BorderColor="#C0C0FF" BorderStyle="Inset" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" Wrap="True" />
               
                <SelectedItemStyle BackColor="LightGray" Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" Wrap="True" />
            </telerik:RadGrid>
   
</asp:Content>

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 24 Jul 2008, 09:36 AM
Hi Hrushikesh,

I found a forum link which discuss a similar error. Go through the link and see if it helps.
Can't get Grid Prometheus working

Thanks
Princy.
0
Daniel
Telerik team
answered on 28 Jul 2008, 12:17 PM
Hello Hrushikesh,

Try the following code to select the desired row
var masterTableView = sender.MasterTableView; 
masterTableView.selectItem(masterTableView.get_dataItems()[desiredRow].get_element()); 

Best wishes,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Hrushikesh Mokashi
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Daniel
Telerik team
Share this question
or