This is a migrated thread and some comments may be shown as answers.
Microsoft JScript runtime error: Unable to set value of the property 'control': object is null or undefined
4 Answers 136 Views
This is a migrated thread and some comments may be shown as answers.
Dhaval
Top achievements
Rank 2
Dhaval asked on 08 Feb 2012, 10:55 AM
Hi,

I am using cascaded drop down and i have used RadAjaxManager to update the another dropdown, but i am getting the following error while using it :

Microsoft JScript runtime error: Unable to set value of the property 'control': object is null or undefined

Moreover, i have the dropdowns in ascx page and i am calling that ascx in aspx. if i take the dropdowns in aspx it works smoothly.

Help me out on this.

Thanks & Regards,
Dhaval Shukla

4 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 09 Feb 2012, 09:21 AM
Hello Dhaval,

How is the user controls added to the page, statically or dynamically? Does the error persist if you disable ajax? Do you have any custom javascript either in the user control or on the page and is it possible the error to come from some line there?

Greetings,
Iana Tsolova
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
syed
Top achievements
Rank 1
answered on 03 May 2012, 06:32 AM
I get the same error when i try to enable "Filter by column", in the RadGrid.
I have a check box to enable or disable this filter. I am using master page with RadScriptManager in it.
The error I get is in content Page (Although the grid is enabled for filtering, but i get that error twice in during testing in development, but no error when i host it to server or else wehre)

Any help on this would be appreciated (see below the image)...

  
0
Iana Tsolova
Telerik team
answered on 08 May 2012, 10:09 AM
Hi syed,

It is hard to tell want is causing the error illustrated in the screenshot. It is too generic and unclear. Can you give us more information on your scenario? What is the grid setup? You can send the markup and code. What actions are triggering the issue?
To recreate the issue on our side, it is also important to know which version of the controls you are using.

Kind regards,
Iana Tsolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Eric
Top achievements
Rank 1
answered on 19 Jul 2012, 06:16 PM
Has there been any resolution to this. I am getting the same error using the RADGrid. If I remove the AllowFilteringByColumn setting, it works fine, no errors. I have another page that uses almost the exact same code, just a different data source, and it works fine with the AllowFilteringByColumn settings in place. In fact, I basically copied the code from the working page to the non-working page and made some minor adjustments. So, it should work.


Non Working File:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConsumerTimes.aspx.cs" Inherits="MoZeus.Report.Web.WebRole.Custom.Mozaic_ATT.ConsumerTimes" %>
<%@ Register TagPrefix="uc" TagName="DatePicker" Src="~/UserControls/DateRangePicker.ascx" %>
<%@ Register TagPrefix="uc" TagName="Footer" Src="~/UserControls/Footer1.ascx"%>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
   <%@ Register TagPrefix="uc" TagName="FormMessage" Src="~/UserControls/FormMessage.ascx" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head id="Head1" runat="server">
    <title>MoZeus Reports</title>
     
    <meta http-equiv="CACHE-CONTROL" content="NO-CACHE"/>
    <meta http-equiv="EXPIRES" content="01 Jan 1970 00:00:00 GMT"/>
    <meta http-equiv="PRAGMA" content="NO-CACHE"/>
    <telerik:RadCodeBlock runat="server" ID="rcbSvyDtlHdr1">
    <link href="<%=ResolveClientUrl("~/css/main.css")%>" rel="stylesheet" type="text/css" /> 
    <script src="<%=ResolveClientUrl("~/js/main.js")%>" type="text/javascript"></script>
        <script type="text/javascript" language="javascript" >
 
            function onRequestStart(sender, args) {
                try {
                    if (args.get_eventTarget().indexOf("btnExportToCSV") >= 0) {
                        args.set_enableAjax(false);
                    }
 
                    if (args.get_eventTarget().indexOf("btnGetReport") >= 0) {
                        document.getElementById('<%=hfExtraHeight.ClientID%>').value = "0";
                    }
                }
                catch (e) { }
            }
 
            function onResponseEnd(sender, args) {
                try {
                    BuildDatePickers();
                } catch (e) { }
            }
            function ShowErrMsg() {
                try {
 
                }
                catch (msg) { }
            }
            function GridCreated(sender, eventArgs) {
                //SizeForm();
            }
 
            function SizeForm() {
                try {
                    var eh = parseInt(document.getElementById('<%=ResolveClientUrl("hfExtraHeight")%>').value);
                    var w = ($(window).width());
                    var h = ($(window).height() - 89);
                    document.getElementById('<%=ResolveClientUrl("hfGridHeight")%>').value = h;
                    document.getElementById('<%=ResolveClientUrl("hfGridWidth")%>').value = w;
                    if (document.getElementById('<%=ResolveClientUrl("SurveyDetails")%>') != null && document.getElementById('<%=ResolveClientUrl("SurveyDetails")%>') != "undefined") {
                        var o = document.getElementById('<%=ResolveClientUrl("SurveyDetails")%>');
                        o.style.width = w + "px";
                        o.style.height = (h + eh) + "px";
                    }
                }
                catch (e) { }
            }
 
        </script>
        <style type="text/css">
            html
            {
                overflow:auto;
            }
 
            html,
            body,
            form
            {
                margin:0;
                height:100%;
                width:100%;
            }
            body{background-color:#ffffff;}
            #dvPageHeader
            {
                background-color:#C9DA2C;
                width:100%;
                padding:0px 0px 0px 0px;
                min-height:32px;               
                max-height:32px;
                background-image:url(<%=ResolveClientUrl("~/img/topbarbggrn4.png")%>);
                background-repeat:repeat-x;  
            }
             
            #dvBackButton
            {
                float:left;
                padding:0px 5px 0px 0px;
                background-image:url(<%=ResolveClientUrl("~/img/btnBack.png")%>);
                background-repeat:no-repeat;
                height:32px;
                width:32px
            }
             
            #dvGetReport
            {
                float:left;
                padding:0px ;
                background-image:url(<%=ResolveClientUrl("~/img/btnGetReport3.png")%>);
                background-repeat:no-repeat;
                height:32px;
                width:80px  
            }
             
            #dvMainBody
            {
                width:100%;
                height:100%;
                background-position:left top;           
                background-color:#C9DA2A;
                background-image:url(<%=ResolveClientUrl("~/img/mozeus_background_big.gif")%>);
                background-repeat:no-repeat;
                border:1px solid #ff0000;
            }
             
            #dvProgramName
            {
                color:#3a3a3c;
                font-size:14px;
                width:100%;
                height:15px;
                text-align:center;
                padding:5px 0px 5px 0px;
                background-color:#ffffff;
            }
            div.RadGrid_Default .rgRow td,
            div.RadGrid_Default .rgAltRow td,
            div.RadGrid_Default .rgResizeCol,
            div.RadGrid_Default .rgFilterRow td,
            div.RadGrid_Default .rgHeader
            {
                border-right:1px solid #3a3a3c; 
            }       
            div.RadGrid_Default .rgRow td,
            div.RadGrid_Default .rgAltRow td,       
            div.RadGrid_Default .rgHeader
            {
                border-bottom:0px;
            }
                     
            div.RadGrid_Default .rgHeader
            {
                border-top:1px solid #3a3a3c; 
            }
            .lblSurvey,.lblProgram,.lblCustomer
            {
                font-weight:bold;  
            }
            .failureNotification
            {
                font-size: 14px;
                font-weight:bold;
                width:100%;
                background-color:#ffffff;
                color: Red;
                padding:0px;
                margin:0px;
            }
            .errMsg
            {
               width:100%;
               font-size: 14px;
            }
            .photoLink
            {
                color:#0000ff;  
            }
        .input3{font-size:11px;width:165px;}
        .label1{font-size:11px;}
        </style>
         
    <asp:PlaceHolder ID="phCSS" runat="server" Visible="false" >        
        <style type="text/css">
            .main
                {
                    background-color:#000000;
                    background-image:url(<%=ResolveClientUrl("~/img/spacer.gif")%>); 
                }
            #tdPoweredBy{color:#000000;}
        </style>
    </asp:PlaceHolder>
        <!--[if IE]>
        <style type="text/css">
            .input2
            {
              height:15px;  
              font-size:13px;
            }
        </style>       
        <![endif]-->
    </telerik:RadCodeBlock>
</head>
<body >
    <form id="form1" runat="server">
     
    <telerik:radscriptmanager runat="server"></telerik:radscriptmanager>
    <telerik:radajaxmanager runat="server" ID="RAM1" ClientEvents-OnResponseEnd="onResponseEnd" ClientEvents-OnRequestStart="onRequestStart" RequestQueueSize="50" >
    <AjaxSettings>
     
        <telerik:AjaxSetting  AjaxControlID="btnGetReport">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlAll" LoadingPanelID="RadAjaxLoadingPanel1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
        <telerik:AjaxSetting  AjaxControlID="btnExportToCSV">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlAll"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
        <telerik:AjaxSetting  AjaxControlID="SurveyDetails">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlAll" LoadingPanelID="RadAjaxLoadingPanel1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
    </AjaxSettings>
    </telerik:radajaxmanager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" InitialDelayTime="0" MinDisplayTime="1500" Skin="Telerik">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server" InitialDelayTime="0" Skin="Transparent">
    </telerik:RadAjaxLoadingPanel>
    <asp:Panel ID="pnlAll" runat="server" Width="100%" Height="100%">
         
        <telerik:RadCodeBlock runat="server" ID="rcbSvyDtlHdr35">
        <asp:HiddenField ID="hfCustomerProgram" runat="server" />
     <asp:HiddenField ID="hfCollapsedColumns" runat="server" />
        <asp:HiddenField ID="hfGridHeight" runat="server" value="600"/>
        <asp:HiddenField ID="hfGridWidth" runat="server" Value="1000" />
        <asp:HiddenField ID="hfExtraHeight" runat="server"  Value="0"/>
        <asp:HiddenField ID="hfLicenseKey" runat="server" />
        <asp:HiddenField ID="hfColNames" runat="server" />
       <div style="float:right;height:0px;position:relative;top:36px;text-align:right;padding-right:3px;">
             <table cellpadding="0" cellspacing="0">
                <tr>
                    <td style="vertical-align:middle;width:155px;height:16px;padding:0px;margin:0px;" ><img src="<%=ResolveClientUrl("~/img/powered_by_mozeus_logo.png")%>" id="img1" title="Powered by MoZeus Worldwide" alt="Powered by MoZeus Worldwide"  style="height:16px;width:155px;margin:0px;padding:0px"/></td>
                </tr>
            </table>
        </div>
        </telerik:RadCodeBlock>
                    <!--Start dvPageHeader-->
                    <div id="dvPageHeader">
                        <!--Start dvBackButton-->
                        <telerik:RadCodeBlock runat="server" ID="rcbSvyDtlHdr2">
                        <div id="dvBackButton" onmouseover="ChangeBgImage(this,'<%=ResolveClientUrl("~/img/btnBack_over.png")%>');"
                        onmouseout="ChangeBgImage(this,'<%=ResolveClientUrl("~/img/btnBack.png")%>');" style="display:none;">
                            <asp:ImageButton ID="btnBack" runat="server"
                            ImageUrl="~/img/spacer.gif"
                            AlternateText="Back To Previous Report"
                            Height="30px"
                            Width="32px"
                            ValidationGroup="GetReportValidationGroup"
                            ToolTip="Back To Previous Report"
                            ImageAlign="AbsMiddle"
                            onclick="btnBack_Click" />
                        </div>
                        </telerik:RadCodeBlock>
                         <!--End dvBackButton-->
                        <!--Start Parameters-->
                          <asp:PlaceHolder ID="phSearchParams" runat="server">
                            <asp:PlaceHolder ID="phLicenseKey" runat="server" Visible="true">
                                <div style="padding:0px 5px 0px 0px;float:left;">
                                <div class="label1" style="padding:8px 5px 0px 5px">
                                    License:
                                </div>
                                <div style="float:left;padding:6px 5px 0px 0px;">
                                    <asp:DropDownList ID="ddlLicenses" runat="server" CssClass="input1 input3">
                                    </asp:DropDownList>
                                </div>
                                </div>
                            </asp:PlaceHolder>
                            <div>
                                <div style="padding:5px 0px 0px 0px;float:left;">
                                    <!--DATE RANGE PICKER-->
                                    <uc:DatePicker id="DatePicker1" runat="server" ValidationGroup="GetReportValidationGroup" CssClass="input1 input2" >
                                    </uc:DatePicker>
                                    <asp:HiddenField ID="hfOriginalStartDate" runat="server" />
                                    <asp:HiddenField ID="hfOriginalEndDate" runat="server" />
                                </div>
                            </div>
                            <asp:PlaceHolder ID="phButton" runat="server">
                            <telerik:RadCodeBlock runat="server" ID="cbSvyDetails2">
                                <div id="dvGetReport" onmouseover="ChangeBgImage(this,'<%=ResolveClientUrl("~/img/btnGetReport3_over.png")%>');"
                                  onmouseout="ChangeBgImage(this,'<%=ResolveClientUrl("~/img/btnGetReport3.png")%>');">
                                    <asp:ImageButton ID="btnGetReport" runat="server"
                                        ImageUrl="~/img/spacer.gif"
                                        AlternateText="Get Report"
                                        Width="80px"
                                        height="30px"
                                        onclick="btnGetReport_Click" 
                                        ValidationGroup="GetReportValidationGroup"
                                        CssClass="button"/>
                                </div>
                            </telerik:RadCodeBlock>
                            </asp:PlaceHolder>
                        </asp:PlaceHolder>
                        <!--End Parameters-->
                        <div style="padding:8px 3px 0px 0px;float:right;">
                            <telerik:RadCodeBlock runat="server" ID="cb1">
                                <div class="dvLogOut" style="display:none;font-family: Arial;">[<a href='<%=ResolveClientUrl("~/Default.aspx")%>?m=<%=((int)MoZeus.Report.Web.WebRole.Enum.Messages.LogOut).ToString()%>'>Log Off</a>]</div>
                                <div class="dvPoweredBy" id="dvStaticPoweredBy" style="display:none">
                                    <table cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td style="vertical-align:middle;width:24px;height:24px;padding:0px;margin:0px;" ><img src="<%=ResolveClientUrl("~/img/powered_by_mozeus_logo3.png")%>" id="imgPwrdBy" title="Powered by MoZeus Worldwide" alt="Powered by MoZeus Worldwide"  style="height:24px;width:24px;margin:0px;padding:0px"/></td>
                                            <td style="vertical-align:middle;height:24px;margin:0px" id="tdPoweredBy">Powered By MoZeus Worldwide</td>
                                        </tr>
                                    </table>
                                </div>
                            </telerik:RadCodeBlock>
                        </div>
                    </div>
                    <!--End dvPageHeader-->
        <!--Start dvMainBody-->
                            
            <div class="errMsg" ID="lblErrMsg" runat="server" visible="false" ></div>
            <uc:FormMessage id="formMessage1" runat="server" text="" />
            <asp:PlaceHolder ID="phCustProgSvyName" runat="server" Visible="true" >
                <div id="dvProgramName">
                    <!--<div style="display:none"> Customer:
                    <asp:Label ID="lblCustomer" runat="server" CssClass="lblCustomer" />
                    <br />
                    Program:
                    <asp:Label ID="lblProgram" runat="server" CssClass="lblProgram" />
                    <br /></div>-->
                    License: <asp:Label ID="lblLicense" runat="server" CssClass="lblSurvey" />
                </div>
            </asp:PlaceHolder>
                <asp:PlaceHolder ID="phExport" runat="server" Visible="false" >
                    <div style="text-align:left;width:100%;border-right:0px;border-left:0px;background:#ffffff;">
                        <telerik:RadCodeBlock runat="server" ID="cbSvyDetails6">
                            <div style="border-right:0px;border-left:0px;padding:0px 0px 0px 0px;background-image:url(<%=ResolveClientUrl("~/img/btnExportCSV.png")%>);
                    background-repeat:no-repeat;height:32px;width:100px" id="dvExport"  onmouseover="ChangeBgImage(this,'<%=ResolveClientUrl("~/img/btnExportCSV_over.png")%>');"   onmouseout="ChangeBgImage(this,'<%=ResolveClientUrl("~/img/btnExportCSV.png")%>');">
                                <asp:ImageButton ID="btnExportToCSV" onclick="btnExportToCSV_Click" runat="server"
                                    ImageUrl="~/img/spacer.gif" AlternateText="Back To Previous Report" Height="32px"
                                    Width="100px" ToolTip="Export to CSV file" ImageAlign="AbsMiddle"/>
                            </div>
                        </telerik:RadCodeBlock>
                    </div>
                </asp:PlaceHolder>
           <asp:PlaceHolder ID="phSurveyDetails" runat="server" Visible="false">
               <telerik:radgrid runat="server" ID="SurveyDetails"
                AllowSorting="True"
                AllowPaging="True"
                PageSize="50"
                runat="server"
                ShowStatusBar="True"
                HeaderStyle-HorizontalAlign="Center"
                ShowHeadersWhenNoRecords="true"
                EnableNoRecordsTemplate="true"
                OnItemCommand="SurveyDetails_ItemCommand" 
                OnNeedDataSource="SurveyDetails_NeedDataSource"
                OnGridExporting="SurveyDetails_GridExporting"
                ShowFooter="True"
                EnableLinqExpressions="False"
                CellSpacing="0"
                GridLines="None"
                style="border:0;outline:none;font-size:12px;"
                OnPageIndexChanged="SurveyDetails_PageIndexChanged"
                oncolumncreated="SurveyDetails_ColumnCreated"
                onitemcreated="SurveyDetails_ItemCreated"
                AllowFilteringByColumn="True" >
                <PagerStyle Mode="NextPrevAndNumeric" Position="Bottom"  AlwaysVisible="true" />
                <ExportSettings ExportOnlyData="true" IgnorePaging="true"  OpenInNewWindow="true">
                    <Csv EncloseDataWithQuotes="false" />
                </ExportSettings>
                <MasterTableView ShowFooter="true" AutoGenerateColumns="true" EnableNoRecordsTemplate="true"
                AllowFilteringByColumn="True" AllowMultiColumnSorting="True" >
                    <NoRecordsTemplate>
                        No records found.</NoRecordsTemplate>
                    <ItemStyle HorizontalAlign="Left" Wrap="false"/>
                    <AlternatingItemStyle HorizontalAlign="Left" Wrap="false"/>
                    <HeaderStyle HorizontalAlign="Center"  Wrap="false"/>
                    <FilterItemStyle HorizontalAlign="Center"/>
                </MasterTableView>
                <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="false"
                    ColumnsReorderMethod="Reorder" AllowExpandCollapse="true">
                    <Animation AllowColumnReorderAnimation="true" AllowColumnRevertAnimation="true" />
                    <Resizing AllowColumnResize="true"  ClipCellContentOnResize="false"  EnableRealTimeResize="true" />
                    <Scrolling AllowScroll="True" UseStaticHeaders="True"  />
                    <ClientEvents OnColumnResized="ColumnResized" OnGridCreated="GridCreated" >
                    </ClientEvents>
                    <DataBinding EnableCaching="true" />
                </ClientSettings>
                <FilterMenu EnableImageSprites="False">
                </FilterMenu></telerik:radgrid>
        </asp:PlaceHolder>
        <!--End dvMainBody-->
 
    </asp:Panel>
<telerik:RadCodeBlock runat="server" ID="cbSvyDetails3">
    <script language="JavaScript" type="text/javascript">
        <!--
        $(document).ready(function () {
            $(function () {
                SizeForm();
            });
 
        });
        $(window).resize(function () {
            SizeForm();
        });
        if (document.images) {
            pic1 = new Image(80, 32);
            pic1.src = '<%=ResolveClientUrl("~/img/btnGetReport3_over.png")%>';
 
            pic2 = new Image(32, 32);
            pic2.src = '<%=ResolveClientUrl("~/img/btnBack_over.png")%>';
 
            pic3 = new Image();
            pic3.src = '<%=ResolveClientUrl("~/img/btnExportCSV_over.png")%>';
        }
 
        function ColumnResized(sender, eventArgs) {
            var indx = eventArgs.get_gridColumn().get_element().cellIndex;
            var masterTableView = $find("<%= SurveyDetails.ClientID %>").get_masterTableView();
            var colName = masterTableView.get_columns()[indx].get_uniqueName();
            var wdth = eventArgs.get_gridColumn().get_element().offsetWidth;
            CheckhfCollapsedColumns(colName, wdth);
        }
 
        function CheckhfCollapsedColumns(colName, wdth) {
            try {
                var s = document.getElementById("<%=hfCollapsedColumns.ClientID%>").value;
                var spl = s.split(';');
                s = '';
                for (var i = 0; i < spl.length; i++) {
                    if (spl[i] != colName && spl[i] != '') {
                        s += spl[i] + ";";
                    }
                }
                if (wdth <= 5) {
                    s += colName;
                }
 
                if (s.lastIndexOf(';') == s.length - 1)
                    s.substring(0, s.length - 2);
                document.getElementById("<%=hfCollapsedColumns.ClientID%>").value = s;
            }
            catch (e) { alert(e); }
 
 
        }
        //-->
 
    </script>
</telerik:RadCodeBlock>
    </form>
</body>
<!--Microsoft recommends doing this to stop caching-->
<head>
<meta http-equiv="PRAGMA" content="NO-CACHE"/>
</head>
</html>


Working file:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="surveydetail.aspx.cs" Inherits="MoZeus.Report.Web.WebRole.Reports.surveydetail" %>
<%@ Register TagPrefix="uc" TagName="DatePicker" Src="~/UserControls/DateRangePicker.ascx" %>
<%@ Register TagPrefix="uc" TagName="Footer" Src="~/UserControls/Footer1.ascx"%>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
   <%@ Register TagPrefix="uc" TagName="FormMessage" Src="~/UserControls/FormMessage.ascx" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head id="Head1" runat="server">
    <title>MoZeus Reports</title>
     
    <meta http-equiv="CACHE-CONTROL" content="NO-CACHE"/>
    <meta http-equiv="EXPIRES" content="01 Jan 1970 00:00:00 GMT"/>
    <meta http-equiv="PRAGMA" content="NO-CACHE"/>
    <telerik:RadCodeBlock runat="server" ID="rcbSvyDtlHdr1">
    <link href="<%=ResolveClientUrl("~/css/main.css")%>" rel="stylesheet" type="text/css" /> 
    <script src="<%=ResolveClientUrl("~/js/jquery-1.6.2.js")%>" type="text/javascript"></script>
    <script src="<%=ResolveClientUrl("~/js/main.js")%>" type="text/javascript"></script>
        <script type="text/javascript" language="javascript" >
 
            function onRequestStart(sender, args)
            {
                try
                {
                    if (args.get_eventTarget().indexOf("btnExportToCSV") >= 0)
                    {
                        args.set_enableAjax(false);
                    }
 
                    if (args.get_eventTarget().indexOf("btnGetReport") >= 0)
                    {
                        document.getElementById('<%=hfExtraHeight.ClientID%>').value = "0";
                        SizeForm();
                    }
                }
                catch (e) { }
            }
 
            function onResponseEnd(sender, args)
            {
                try
                {
                    SizeForm();
                    BuildDatePickers();
                } catch (e) { }
            }
            function ShowErrMsg()
            {
                try
                {
 
                }
                catch (msg) { }
            }
            function GridCreated(sender, eventArgs)
            {
                SizeForm();
            }
 
 
            function SizeForm()
            {
                try
                {
                    var eh = parseInt(document.getElementById('<%=hfExtraHeight.ClientID%>').value);
                    var w = ($(window).width());
                    var h = ($(window).height() - 89);
                    document.getElementById('<%=hfGridHeight.ClientID%>').value = h;
                    document.getElementById('<%=hfGridWidth.ClientID%>').value = w;
                    if (document.getElementById('<%=SurveyDetails.ClientID%>') != null && document.getElementById('<%=SurveyDetails.ClientID%>') != "undefined")
                    {
                        var o = document.getElementById('<%=SurveyDetails.ClientID%>');
                        o.style.width = w + "px";
                        o.style.height = (h + eh) + "px";
                    }
                }
                catch (e) { }
            }
            $(document).ready(function ()
            {
                $(function ()
                {
                    SizeForm();
                });
 
            });
            $(window).resize(function ()
            {
                SizeForm();
            });
 
        </script>
        <style type="text/css">
            html
            {
                overflow:auto;
            }
 
            html,
            body,
            form
            {
                margin:0;
                height:100%;
                width:100%;
            }
            body{background-color:#ffffff;}
            #dvPageHeader
            {
                background-color:#C9DA2C;
                width:100%;
                padding:0px 0px 0px 0px;
                min-height:32px;               
                max-height:32px;
                background-image:url(../img/topbarbggrn4.png);
                background-repeat:repeat-x;  
            }
             
            #dvBackButton
            {
                float:left;
                padding:0px 5px 0px 0px;
                background-image:url(<%=ResolveClientUrl("~/img/btnBack.png")%>);
                background-repeat:no-repeat;
                height:32px;
                width:32px
            }
             
            #dvGetReport
            {
                float:left;
                padding:0px ;
                background-image:url(<%=ResolveClientUrl("~/img/btnGetReport3.png")%>);
                background-repeat:no-repeat;
                height:32px;
                width:80px  
            }
             
            #dvMainBody
            {
                width:100%;
                height:100%;
                background-position:left top;           
                background-color:#C9DA2A;
                background-image:url(<%=ResolveClientUrl("~/img/mozeus_background_big.gif")%>);
                background-repeat:no-repeat;
                border:1px solid #ff0000;
            }
             
            #dvProgramName
            {
                color:#3a3a3c;
                font-size:14px;
                width:100%;
                height:15px;
                text-align:center;
                padding:5px 0px 5px 0px;
                background-color:#ffffff;
            }
            div.RadGrid_Default .rgRow td,
            div.RadGrid_Default .rgAltRow td,
            div.RadGrid_Default .rgResizeCol,
            div.RadGrid_Default .rgFilterRow td,
            div.RadGrid_Default .rgHeader
            {
                border-right:1px solid #3a3a3c; 
            }       
            div.RadGrid_Default .rgRow td,
            div.RadGrid_Default .rgAltRow td,       
            div.RadGrid_Default .rgHeader
            {
                border-bottom:0px;
            }
                     
            div.RadGrid_Default .rgHeader
            {
                border-top:1px solid #3a3a3c; 
            }
            .lblSurvey,.lblProgram,.lblCustomer
            {
                font-weight:bold;  
            }
            .failureNotification
            {
                font-size: 14px;
                font-weight:bold;
                width:100%;
                background-color:#ffffff;
                color: Red;
                padding:0px;
                margin:0px;
            }
            .errMsg
            {
               width:100%;
               font-size: 14px;
            }
            .photoLink
            {
                color:#0000ff;  
            }
        </style>
         
    <asp:PlaceHolder ID="phCSS" runat="server" Visible="false" >        
        <style type="text/css">
            .main
                {
                    background-color:#000000;
                    background-image:url(<%=ResolveClientUrl("~/img/spacer.gif")%>); 
                }
            #tdPoweredBy{color:#000000;}
        </style>
    </asp:PlaceHolder>
        <!--[if IE]>
        <style type="text/css">
            .input2
            {
              height:15px;  
              font-size:13px;
            }
        </style>       
        <![endif]-->
    </telerik:RadCodeBlock>
</head>
<body onload="SizeForm()" >
    <form id="form1" runat="server">
     
    <telerik:radscriptmanager runat="server"></telerik:radscriptmanager>
    <telerik:radajaxmanager runat="server" ID="RAM1" ClientEvents-OnResponseEnd="onResponseEnd" ClientEvents-OnRequestStart="onRequestStart" RequestQueueSize="50" >
    <AjaxSettings>
     
        <telerik:AjaxSetting  AjaxControlID="btnGetReport">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlAll" LoadingPanelID="RadAjaxLoadingPanel1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
        <telerik:AjaxSetting  AjaxControlID="btnExportToCSV">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlAll"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
        <telerik:AjaxSetting  AjaxControlID="SurveyDetails">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlAll" LoadingPanelID="RadAjaxLoadingPanel1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
        <telerik:AjaxSetting  AjaxControlID="ddlSurvey">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlSurvey" LoadingPanelID="RadAjaxLoadingPanel2"/>
                    <telerik:AjaxUpdatedControl ControlID="ddlSurveyVersion" LoadingPanelID="RadAjaxLoadingPanel2"/>
                    <telerik:AjaxUpdatedControl ControlID="DatePicker1" LoadingPanelID="RadAjaxLoadingPanel2"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
    </AjaxSettings>
    </telerik:radajaxmanager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" InitialDelayTime="0" MinDisplayTime="1500" Skin="Telerik">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server" InitialDelayTime="0" Skin="Transparent">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true" Behaviors="Close, Move, Resize,Maximize" >
        <Windows>
            <telerik:RadWindow ID="PreviewWindow" runat="server" Title="View Photo" ReloadOnShow="true" ShowContentDuringLoad="false"
                Modal="true" Skin="Black" IconUrl="../img/iconmozeus.png" VisibleStatusbar="false"
                Behaviors="Close,Move" AutoSizeBehaviors="Default" AutoSize="true" KeepInScreenBounds="true" DestroyOnClose="true" height="240" width="320">
                <ContentTemplate>
                    <img src="javascript:void(0);" alt="Image holder" id="imageHolder" />
                </ContentTemplate>
                </telerik:RadWindow
        </Windows>
    </telerik:RadWindowManager>
    <asp:Panel ID="pnlAll" runat="server" Width="100%" Height="100%">
         
        <telerik:RadCodeBlock runat="server" ID="rcbSvyDtlHdr35">
        <asp:HiddenField ID="hfCustomerProgram" runat="server" />
     <asp:HiddenField ID="hfCollapsedColumns" runat="server" />
        <asp:HiddenField ID="hfGridHeight" runat="server" value="600"/>
        <asp:HiddenField ID="hfGridWidth" runat="server" Value="1000" />
        <asp:HiddenField ID="hfExtraHeight" runat="server"  Value="0"/>
        <asp:HiddenField ID="hfLicenseKey" runat="server" />
        <asp:HiddenField ID="hfColNames" runat="server" />
       <div style="float:right;height:0px;position:relative;top:36px;text-align:right;padding-right:3px;">
             <table cellpadding="0" cellspacing="0">
                <tr>
                    <td style="vertical-align:middle;width:155px;height:16px;padding:0px;margin:0px;" ><img src="<%=ResolveClientUrl("~/img/powered_by_mozeus_logo.png")%>" id="img1" title="Powered by MoZeus Worldwide" alt="Powered by MoZeus Worldwide"  style="height:16px;width:155px;margin:0px;padding:0px"/></td>
                </tr>
            </table>
        </div>
        </telerik:RadCodeBlock>
                    <!--Start dvPageHeader-->
                    <div id="dvPageHeader">
                        <!--Start dvBackButton-->
                        <telerik:RadCodeBlock runat="server" ID="rcbSvyDtlHdr2">
                        <div id="dvBackButton" onmouseover="ChangeBgImage(this,'<%=ResolveClientUrl("~/img/btnBack_over.png")%>');"
                        onmouseout="ChangeBgImage(this,'<%=ResolveClientUrl("~/img/btnBack.png")%>');" style="display:none;">
                            <asp:ImageButton ID="btnBack" runat="server"
                            ImageUrl="~/img/spacer.gif"
                            AlternateText="Back To Previous Report"
                            Height="30px"
                            Width="32px"
                            ValidationGroup="GetReportValidationGroup"
                            ToolTip="Back To Previous Report"
                            ImageAlign="AbsMiddle"
                            onclick="btnBack_Click" />
                        </div>
                        </telerik:RadCodeBlock>
                         <!--End dvBackButton-->
                        <!--Start Parameters-->
                          <asp:PlaceHolder ID="phSearchParams" runat="server">
                            <asp:PlaceHolder ID="phReportDDL" runat="server" Visible="false">
                                <div class="label1" style="float:left;padding:8px 5px 0px 5px;">
                                Report:
                                </div>
                                <div style="float:left;padding:6px 5px 0px 0px;">
                                    <asp:DropDownList ID="ddlReport" runat="server" CssClass="input1">
                                    </asp:DropDownList>
                                </div>
                                <asp:HiddenField runat="server" ID="hfDbGuidId">
                                </asp:HiddenField>
                                <asp:HiddenField runat="server" ID="hfParentDbGuidId">
                                </asp:HiddenField>
                            </asp:PlaceHolder>
                            <asp:PlaceHolder ID="phLicenseKey" runat="server" Visible="false">
                                <div style="padding:0px 5px 0px 0px;float:left;">
                                <div class="label1" style="padding:8px 5px 0px 5px">
                                    License:
                                </div>
                                <div style="float:left;padding:6px 5px 0px 0px;">
                                    <asp:DropDownList ID="ddlLicenses" runat="server" CssClass="input13">
                                    </asp:DropDownList>
                                </div>
                                </div>
                            </asp:PlaceHolder>
                            <div class="label1" style="float:left;padding:8px 5px 0px 5px;">
                            Survey:
                            </div>
                            <div style="float:left;padding:6px 5px 0px 0px;">
                                <asp:DropDownList ID="ddlSurvey" runat="server" CssClass="input1" onselectedindexchanged="ddlSurvey_SelectedIndexChanged" AutoPostBack="true"/>
                            </div>
                            <div class="label1" style="float:left;padding:8px 5px 0px 0px;">
                            Version:
                            </div>
                            <div style="float:left;padding:6px 5px 0px 0px;">
                                <asp:DropDownList ID="ddlSurveyVersion" runat="server" CssClass="input1">
                                </asp:DropDownList>
                            </div>
                            <div>
                                <div style="padding:5px 0px 0px 0px;float:left;">
                                    <!--DATE RANGE PICKER-->
                                    <uc:DatePicker id="DatePicker1" runat="server" ValidationGroup="GetReportValidationGroup" CssClass="input1 input2" >
                                    </uc:DatePicker>
                                    <asp:HiddenField ID="hfOriginalStartDate" runat="server" />
                                    <asp:HiddenField ID="hfOriginalEndDate" runat="server" />
                                </div>
                            </div>
                            <telerik:RadCodeBlock runat="server" ID="cbSvyDetails2">
                                <div id="dvGetReport" onmouseover="ChangeBgImage(this,'<%=ResolveClientUrl("~/img/btnGetReport3_over.png")%>');"
                                  onmouseout="ChangeBgImage(this,'<%=ResolveClientUrl("~/img/btnGetReport3.png")%>');">
                                    <asp:ImageButton ID="btnGetReport" runat="server"
                                        ImageUrl="~/img/spacer.gif"
                                        AlternateText="Get Report"
                                        Width="80px"
                                        height="30px"
                                        onclick="btnGetReport_Click" 
                                        ValidationGroup="GetReportValidationGroup"
                                        CssClass="button"/>
                                </div>
                            </telerik:RadCodeBlock>
                        </asp:PlaceHolder>
                        <!--End Parameters-->
                        <div style="padding:8px 3px 0px 0px;float:right;">
                            <telerik:RadCodeBlock runat="server" ID="cb1">
                                <div class="dvLogOut" style="display:none;font-family: Arial;">[<a href='<%=ResolveClientUrl("~/Default.aspx")%>?m=<%=((int)MoZeus.Report.Web.WebRole.Enum.Messages.LogOut).ToString()%>'>Log Off</a>]</div>
                                <div class="dvPoweredBy" id="dvStaticPoweredBy" style="display:none">
                                    <table cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td style="vertical-align:middle;width:24px;height:24px;padding:0px;margin:0px;" ><img src="<%=ResolveClientUrl("~/img/powered_by_mozeus_logo3.png")%>" id="imgPwrdBy" title="Powered by MoZeus Worldwide" alt="Powered by MoZeus Worldwide"  style="height:24px;width:24px;margin:0px;padding:0px"/></td>
                                            <td style="vertical-align:middle;height:24px;margin:0px" id="tdPoweredBy">Powered By MoZeus Worldwide</td>
                                        </tr>
                                    </table>
                                </div>
                            </telerik:RadCodeBlock>
                        </div>
                    </div>
                    <!--End dvPageHeader-->
        <!--Start dvMainBody-->
                            
            <div class="errMsg" ID="lblErrMsg" runat="server" visible="false" ></div>
            <uc:FormMessage id="formMessage1" runat="server" text="" />
            <asp:PlaceHolder ID="phCustProgSvyName" runat="server" Visible="true" >
                <div id="dvProgramName">
                    <!--<div style="display:none"> Customer:
                    <asp:Label ID="lblCustomer" runat="server" CssClass="lblCustomer" />
                    <br />
                    Program:
                    <asp:Label ID="lblProgram" runat="server" CssClass="lblProgram" />
                    <br /></div>-->
                    License: <asp:Label ID="lblLicense" runat="server" CssClass="lblSurvey" /> | Survey: <asp:Label ID="lblSurvey" runat="server" CssClass="lblSurvey" />
                </div>
            </asp:PlaceHolder>
                <asp:PlaceHolder ID="phExport" runat="server" Visible="false" >
                    <div style="text-align:left;width:100%;border-right:0px;border-left:0px;background:#ffffff;">
                        <telerik:RadCodeBlock runat="server" ID="cbSvyDetails6">
                            <div style="border-right:0px;border-left:0px;padding:0px 0px 0px 0px;background-image:url(<%=ResolveClientUrl("~/img/btnExportCSV.png")%>);
                    background-repeat:no-repeat;height:32px;width:100px" id="dvExport"  onmouseover="ChangeBgImage(this,'<%=ResolveClientUrl("~/img/btnExportCSV_over.png")%>');"   onmouseout="ChangeBgImage(this,'<%=ResolveClientUrl("~/img/btnExportCSV.png")%>');">
                                <asp:ImageButton ID="btnExportToCSV" onclick="btnExportToCSV_Click" runat="server"
                                    ImageUrl="~/img/spacer.gif" AlternateText="Back To Previous Report" Height="32px"
                                    Width="100px" ToolTip="Export to CSV file" ImageAlign="AbsMiddle"/>
                            </div>
                        </telerik:RadCodeBlock>
                    </div>
                </asp:PlaceHolder>
           <asp:PlaceHolder ID="phSurveyDetails" runat="server" Visible="false">
            <telerik:RadGrid ID="SurveyDetails"
                AllowSorting="True"
                AllowPaging="True"
                PageSize="50"
                runat="server"
                AllowFilteringByColumn="True"
                ShowStatusBar="True"
                HeaderStyle-HorizontalAlign="Center"
                ShowHeadersWhenNoRecords="true"
                EnableNoRecordsTemplate="true"
                OnItemCommand="SurveyDetails_ItemCommand" 
                OnNeedDataSource="SurveyDetails_NeedDataSource"
                OnGridExporting="SurveyDetails_GridExporting"
                ShowFooter="True"
                EnableLinqExpressions="False"
                CellSpacing="0"
                GridLines="None"
                style="border:0;outline:none;font-size:12px;"
                OnPageIndexChanged="SurveyDetails_PageIndexChanged"
                oncolumncreated="SurveyDetails_ColumnCreated"
                onitemcreated="SurveyDetails_ItemCreated">
                <PagerStyle Mode="NextPrevAndNumeric" Position="Bottom"  AlwaysVisible="true" />
                <ExportSettings ExportOnlyData="true" IgnorePaging="true"  OpenInNewWindow="true">
                    <Csv EncloseDataWithQuotes="false" />
                </ExportSettings>
                <MasterTableView ShowFooter="true" AutoGenerateColumns="true" EnableNoRecordsTemplate="true" AllowFilteringByColumn="true" AllowMultiColumnSorting="True" >
                    <NoRecordsTemplate>
                        No records found.</NoRecordsTemplate>
                    <ItemStyle HorizontalAlign="Left" Wrap="false"/>
                    <AlternatingItemStyle HorizontalAlign="Left" Wrap="false"/>
                    <HeaderStyle HorizontalAlign="Center"  Wrap="false"/>
                    <FilterItemStyle HorizontalAlign="Center"/>
                </MasterTableView>
                <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="false"
                    ColumnsReorderMethod="Reorder" AllowExpandCollapse="true">
                    <Animation AllowColumnReorderAnimation="true" AllowColumnRevertAnimation="true" />
                    <Resizing AllowColumnResize="true"  ClipCellContentOnResize="false"  EnableRealTimeResize="true" />
                    <Scrolling AllowScroll="True" UseStaticHeaders="True"  />
                    <ClientEvents OnColumnResized="ColumnResized" OnGridCreated="GridCreated" >
                    </ClientEvents>
                    <DataBinding EnableCaching="true" />
                </ClientSettings>
                <FilterMenu EnableImageSprites="False">
                </FilterMenu>
            </telerik:RadGrid>
        </asp:PlaceHolder>
        <!--End dvMainBody-->
 
    </asp:Panel>
<telerik:RadCodeBlock runat="server" ID="cbSvyDetails3">
    <script language="JavaScript" type="text/javascript">
        <!--
        if (document.images)
        {
            pic1 = new Image(80, 32);
            pic1.src = '<%=ResolveClientUrl("~/img/btnGetReport3_over.png")%>';
 
            pic2 = new Image(32, 32);
            pic2.src = '<%=ResolveClientUrl("~/img/btnBack_over.png")%>';
 
            pic3 = new Image();
            pic3.src = '<%=ResolveClientUrl("~/img/btnExportCSV_over.png")%>';
        }
 
        function ColumnResized(sender, eventArgs)
        {
            var indx = eventArgs.get_gridColumn().get_element().cellIndex;
            var masterTableView = $find("<%= SurveyDetails.ClientID %>").get_masterTableView();
            var colName = masterTableView.get_columns()[indx].get_uniqueName();
            var wdth = eventArgs.get_gridColumn().get_element().offsetWidth;
            CheckhfCollapsedColumns(colName, wdth);
        }
 
        function CheckhfCollapsedColumns(colName, wdth)
        {
            try
            {
                var s = document.getElementById("<%=hfCollapsedColumns.ClientID%>").value;
                var spl = s.split(';');
                s = '';
                for (var i = 0; i < spl.length; i++)
                {
                    if (spl[i] != colName && spl[i] != '')
                    {
                        s += spl[i] + ";";
                    }
                }
                if (wdth <= 5)
                {
                    s += colName;
                }
 
                if (s.lastIndexOf(';') == s.length - 1)
                    s.substring(0, s.length - 2);
                document.getElementById("<%=hfCollapsedColumns.ClientID%>").value = s;
            }
            catch (e) { alert(e); }
 
 
        }
                SizeForm();
        //-->
 
    </script>
</telerik:RadCodeBlock>
    </form>
</body>
<!--Microsoft recommends doing this to stop caching-->
<head>
<meta http-equiv="PRAGMA" content="NO-CACHE"/>
</head>
</html>


Thanks,
Eric
Tags
Ajax
Asked by
Dhaval
Top achievements
Rank 2
Answers by
Iana Tsolova
Telerik team
syed
Top achievements
Rank 1
Eric
Top achievements
Rank 1
Share this question
or