PopUp Intermittantly Fires

3 posts, 1 answers
  1. Doug Odegaard
    Doug Odegaard avatar
    52 posts
    Member since:
    Oct 2004

    Posted 19 Feb 2008 Link to this post

    I have one page in my application where the DatePicker will not fire and simply places a pound (#) symbol in the URL.  The javascript appears to be working in the text box part of the control as it changes to red and icon upon a bad format.  The page has a AjaxManager on it which controls other areas of the page.  The interesting thing is that when I uncheck one of those controls and recheck it (an AutoPostBack is happening with it) then the PopUp comes back.  I simply cannot find why that would happen.  Here are the code blocks if anyone can help.  Thanks in advance.
    Doug

    ASPX page -- dateStart and dateEnd are my DatePickers.  chkCheckAll is the checkbox that seems to release the PopUps upon postback through the AJAX.

     

    1 <%@ Page language="c#" Codebehind="DamageSearch.aspx.cs" AutoEventWireup="True" Inherits="ELM.TicketManagementSystem.DamageSearchForm" %> 
    2 <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    3 <%@ Register TagPrefix="layout" TagName="DefaultHeader" Src="components/controls/DefaultHeader.ascx" %> 
    4 <%@ Register TagPrefix="layout" TagName="DefaultFooter" Src="components/controls/DefaultFooter.ascx" %> 
    5 <%@ Register TagPrefix="nav" TagName="MainNav" Src="components/controls/MainNav.ascx" %> 
    6 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 
    7 <HTML> 
    8     <HEAD> 
    9         <title>LaunchPoint Ticket Management Portal - Damage Search</title> 
    10         <META http-equiv="Content-Type" content="text/html; charset=windows-1252">  
    11         <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">  
    12         <meta content="C#" name="CODE_LANGUAGE">  
    13         <meta content="JavaScript" name="vs_defaultClientScript">  
    14         <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">  
    15         <LINK href="lib/StyleSheet1.css" type="text/css" rel="stylesheet">  
    16     </HEAD> 
    17     <body bgColor="white" leftMargin="0" topMargin="0">  
    18         <form id="pageForm" name="pageForm" runat="server">  
    19             <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
    20             </telerik:RadScriptManager> 
    21             <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">  
    22                 <AjaxSettings> 
    23                     <telerik:AjaxSetting AjaxControlID="rbLocation">  
    24                         <UpdatedControls> 
    25                             <telerik:AjaxUpdatedControl ControlID="chkSearchAll" /> 
    26                             <telerik:AjaxUpdatedControl ControlID="ddStateList" /> 
    27                             <telerik:AjaxUpdatedControl ControlID="drpProfitCenters" /> 
    28                             <telerik:AjaxUpdatedControl ControlID="txtDamage" /> 
    29                         </UpdatedControls> 
    30                     </telerik:AjaxSetting> 
    31                     <telerik:AjaxSetting AjaxControlID="chkSearchAll">  
    32                         <UpdatedControls> 
    33                             <telerik:AjaxUpdatedControl ControlID="ddStateList" /> 
    34                             <telerik:AjaxUpdatedControl ControlID="drpProfitCenters" /> 
    35                         </UpdatedControls> 
    36                     </telerik:AjaxSetting> 
    37                     <telerik:AjaxSetting AjaxControlID="ddStateList">  
    38                         <UpdatedControls> 
    39                             <telerik:AjaxUpdatedControl ControlID="drpProfitCenters" /> 
    40                         </UpdatedControls> 
    41                     </telerik:AjaxSetting> 
    42                     <telerik:AjaxSetting AjaxControlID="rbDamage">  
    43                         <UpdatedControls> 
    44                             <telerik:AjaxUpdatedControl ControlID="chkSearchAll" /> 
    45                             <telerik:AjaxUpdatedControl ControlID="ddStateList" /> 
    46                             <telerik:AjaxUpdatedControl ControlID="drpProfitCenters" /> 
    47                             <telerik:AjaxUpdatedControl ControlID="txtDamage" /> 
    48                         </UpdatedControls> 
    49                     </telerik:AjaxSetting> 
    50                     <telerik:AjaxSetting AjaxControlID="btnSearch">  
    51                         <UpdatedControls> 
    52                             <telerik:AjaxUpdatedControl ControlID="LblSearchResults" /> 
    53                             <telerik:AjaxUpdatedControl ControlID="gridDamage" /> 
    54                         </UpdatedControls> 
    55                     </telerik:AjaxSetting> 
    56 </AjaxSettings> 
    57             </telerik:RadAjaxManager> 
    58             <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" 
    59                 Width="75px">  
    60                 <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' 
    61                     style="border: 0px;" /> 
    62             </telerik:RadAjaxLoadingPanel> 
    63             <layout:defaultheader id="HeaderControl" runat="server"></layout:defaultheader> 
    64             <table cellSpacing="0" cellPadding="0" width="996" border="0">  
    65                 <tr> 
    66                     <td width="10" bgColor="#993333"><IMG height="1" src="images/spacer.gif" width="10" border="0">  
    67                     </td> 
    68                     <td vAlign="top" align="left" width="196" bgColor="#993333">  
    69                         <!-- Page Navigation --><NAV:MAINNAV id="MainNav" RUNAT="SERVER"></NAV:MAINNAV><br>  
    70                         <img height=10 src='~/images/spacer.gif' width=2 border=0 /><asp:Button ID="btnNewDamage" runat="server" Text="Enter New Damage" OnClick="btnNewDamage_Click" /><br /> 
    71                         <br /> 
    72                         <asp:Panel ID="pSearchDamageNav" runat="server" Height="50px" Width="125px">  
    73                         <table style="FONT-SIZE: 10pt; WIDTH: 180px; FONT-FAMILY: Arial; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #eeeeee" 
    74     cellSpacing="0" rules="all" width="180" bgColor="#eeeeee" border="0">  
    75     <tr bgColor="#ff9933">  
    76         <td style="width: 5px"><img height=10 src='~/images/spacer.gif' width=5 border=0 /> 
    77         </td> 
    78         <td class="whitetextbold" align="left" style="width: 180px"><asp:radiobutton id="rbLocation" GroupName="search" Text="Search By Fields" CssClass="whitetextbold" 
    79                 runat="server" AutoPostBack="True" Checked="True" OnCheckedChanged="rbLocation_CheckedChanged"></asp:radiobutton></td>  
    80     </tr> 
    81     <tr> 
    82         <td colSpan="2"><img height=5 src='~/images/spacer.gif' border=0 /></td>  
    83     </tr> 
    84     <tr> 
    85         <td style="width: 5px">  
    86         </td> 
    87         <td class="text" vAlign="middle" align="left" style="width: 180px"><asp:checkbox id="chkSearchAll" Text=" Search All My Areas" runat="server" 
    88                 Width="152px" Checked="True" AutoPostBack="True" OnCheckedChanged="chkSearchAll_CheckedChanged"></asp:checkbox></td>  
    89     </tr> 
    90     <tr> 
    91         <td style="width: 5px">  
    92         </td> 
    93         <td class="text" vAlign="middle" align="left" style="width: 180px"><asp:dropdownlist id="ddStateList" runat="server" Width="160px" OnChange="javacript:SetPageFocus();" AutoPostBack="True" Enabled="False" OnSelectedIndexChanged="ddStateList_SelectedIndexChanged"></asp:dropdownlist></td>  
    94     </tr> 
    95     <tr> 
    96         <td colSpan="2"></td> 
    97     </tr> 
    98         <TR> 
    99             <TD width="5">  
    100             </TD> 
    101             <TD class="text" vAlign="middle" align="left">  
    102                 <asp:dropdownlist id="drpProfitCenters" runat="server" Width="160px" Enabled="False"></asp:dropdownlist></TD>  
    103         </TR> 
    104     <tr> 
    105         <td colSpan="2"></td> 
    106     </tr> 
    107     <tr bgColor="#ff9933">  
    108         <td style="width: 5px"><img height=10   
    109       src='~/images/spacer.gif' width=5 border=0   
    110       > 
    111         </td> 
    112         <td class="whitetextbold" align="left" style="width: 180px"><asp:radiobutton id="rbDamage" GroupName="search" Text="Search By Damage #" CssClass="whitetextbold" 
    113                 runat="server" AutoPostBack="True" OnCheckedChanged="rbDamage_CheckedChanged"></asp:radiobutton></td>  
    114     </tr> 
    115     <tr> 
    116         <td colSpan="2"><img height=5   
    117       src='~/images/spacer.gif' border=0   
    118       ></td>  
    119     </tr> 
    120     <tr> 
    121         <td style="width: 5px"><img height=10   
    122       src='~/images/spacer.gif' width=5 border=0   
    123       > 
    124         </td> 
    125         <td class="text" vAlign="middle" align="left" style="width: 180px"><asp:textbox id="txtDamage" runat="server" Visible="False"></asp:textbox></td>  
    126     </tr> 
    127     <tr> 
    128         <td colSpan="2"></td> 
    129     </tr> 
    130     <tr> 
    131         <td colSpan="2" style="height: 7px"><img height=5   
    132       src='~/images/spacer.gif' border=0   
    133       ></td>  
    134     </tr> 
    135     <tr> 
    136         <td class="text" vAlign="middle" align="center" colSpan="2"><asp:button id="btnSearch" OnClick="btnSearch_Click" Text="Search" runat="server"></asp:button></td>  
    137     </tr> 
    138     <tr> 
    139         <td colSpan="2"><img height=5   
    140       src='~/images/spacer.gif' border=0   
    141       ></td>  
    142     </tr> 
    143 </table> 
    144                         </asp:Panel> 
    145                         <br /> 
    146                         <!-- End Navigation --></td>  
    147                     <td width="2" bgColor="#000000"><IMG height="500" src="images/spacer.gif" width="2">  
    148                     </td> 
    149                     <td width="10">&nbsp;</td> 
    150                     <td vAlign="top" align="center" style="width: 800px">  
    151                         <!-- Main Page Content --> 
    152                         <div style="TEXT-ALIGN: center"><asp:label id="lblTitle" Runat="server" CssClass="blueheader">Damage Search</asp:label></div>  
    153                         <div style="TEXT-ALIGN: left"><asp:label id="MyError" CssClass="redtextbold" Runat="server"></asp:label></div>  
    154                         <table cellSpacing="0" cellPadding="1" border="0" > 
    155                             <tr> 
    156                                 <td align="left" colspan="6" rowspan="1" valign="top">  
    157                                     <table style="width: 700px">  
    158                                         <tr> 
    159                                             <td rowspan="4">  
    160                                     <table cellpadding="4" cellspacing="4">  
    161                                         <tr bgColor="#000066">  
    162                                             <td colspan="2" class="whiteTextBold">  
    163                                                 Damage Date</td> 
    164                                         </tr> 
    165                                         <tr> 
    166                                             <td> 
    167                                                 <asp:Label ID="lblStartDate" runat="server" CssClass="bluetextbold" Text="Start"></asp:Label></td>  
    168                                             <td> 
    169                                                 <telerik:RadDatePicker ID="dateStart" runat="server">  
    170                                                     <DatePopupButton CssClass="radPopupImage_Default" /> 
    171                                                     <Calendar CellAlign="Center" CellVAlign="Middle" DayNameFormat="FirstLetter" FirstDayOfWeek="Default" 
    172                                                         MonthLayout="Layout_7columns_x_6rows" Orientation="RenderInRows" TitleAlign="Center" 
    173                                                         UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False">  
    174                                                     </Calendar> 
    175                                                     <DateInput Width="100%">  
    176                                                     </DateInput> 
    177                                                 </telerik:RadDatePicker> 
    178                                             </td> 
    179                                         </tr> 
    180                                         <tr> 
    181                                             <td> 
    182                                                 <asp:Label ID="lblEndDate" runat="server" CssClass="bluetextbold" Text="End"></asp:Label></td>  
    183                                             <td> 
    184                                                 <telerik:RadDatePicker ID="dateEnd" runat="server">  
    185                                                     <DatePopupButton CssClass="radPopupImage_Default" /> 
    186                                                     <Calendar CellAlign="Center" CellVAlign="Middle" DayNameFormat="FirstLetter" FirstDayOfWeek="Default" 
    187                                                         MonthLayout="Layout_7columns_x_6rows" Orientation="RenderInRows" TitleAlign="Center" 
    188                                                         UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False">  
    189                                                     </Calendar> 
    190                                                     <DateInput Width="100%">  
    191                                                     </DateInput> 
    192                                                 </telerik:RadDatePicker> 
    193                                             </td> 
    194                                         </tr> 
    195                                     </table> 
    196                                             </td> 
    197                                             <td> 
    198                                     <asp:Label ID="Label2" runat="server" CssClass="bluetextbold" Text="Utility:"></asp:Label> 
    199                                     <asp:DropDownList ID="ddlUtility" runat="server" Width="391px">  
    200                                     </asp:DropDownList></td>  
    201                                         </tr> 
    202                                         <tr> 
    203                                             <td> 
    204                                     <asp:Label ID="lblLocator" runat="server" CssClass="bluetextbold" Text="Locator:"></asp:Label> 
    205                                                 <asp:DropDownList  
    206                                         ID="ddlLocator" runat="server" Width="377px">  
    207                                     </asp:DropDownList></td>  
    208                                         </tr> 
    209                                         <tr> 
    210                                             <td> 
    211                                     <asp:Label ID="lblDamageAddress" runat="server" CssClass="bluetextbold" Text="Damage Address:"></asp:Label> 
    212                                     <asp:TextBox ID="txtDamageAddress" runat="server" Width="324px"></asp:TextBox></td>  
    213                                         </tr> 
    214                                         <tr> 
    215                                             <td> 
    216                                                 <asp:Label ID="Label3" runat="server" CssClass="bluetextbold" Text="City:"></asp:Label> 
    217                                     <asp:TextBox ID="txtCity" runat="server"></asp:TextBox> 
    218                                     <asp:Label ID="lblState" runat="server" CssClass="bluetextbold" Text="State:"></asp:Label> 
    219                                     <asp:DropDownList ID="ddlState" runat="server" Width="90px">  
    220                                     </asp:DropDownList></td>  
    221                                         </tr> 
    222                                     </table> 
    223                                 </td> 
    224                             </tr> 
    225                             <tr> 
    226                                 <td align="center" colspan="5" rowspan="1" valign="top">  
    227                                     <table> 
    228                                         <tr bgColor="#000066">  
    229                                             <td class="whitetextbold">  
    230                                                 &nbsp;Status  
    231                                             </td> 
    232                                             <td class="whitetextbold">  
    233                                                 &nbsp;Liable</td> 
    234                                             <td class="whitetextbold">  
    235                                                 &nbsp;A/R Status</td> 
    236                                         </tr> 
    237                                         <tr> 
    238                                             <td> 
    239                                                 <asp:CheckBoxList ID="cblStatus" runat="server" CssClass="bluetextbold" RepeatColumns="2" Width="200px">  
    240                                                     <asp:ListItem Value="1">Pending</asp:ListItem> 
    241                                                     <asp:ListItem Value="2">Inactive</asp:ListItem> 
    242                                                     <asp:ListItem Value="3">Active</asp:ListItem> 
    243                                                     <asp:ListItem Value="4">Accepted</asp:ListItem> 
    244                                                     <asp:ListItem Value="5">Paid</asp:ListItem> 
    245                                                     <asp:ListItem Value="6">Drop/Rebill</asp:ListItem> 
    246                                                     <asp:ListItem Value="7">Escalated</asp:ListItem> 
    247                                                 </asp:CheckBoxList></td>  
    248                                             <td valign="top">  
    249                                                 <asp:CheckBoxList ID="cblLiable" runat="server" CssClass="bluetextbold" Width="110px">  
    250                                                     <asp:ListItem>Yes</asp:ListItem> 
    251                                                     <asp:ListItem>No</asp:ListItem> 
    252                                                     <asp:ListItem>Possibly</asp:ListItem> 
    253                                                 </asp:CheckBoxList></td>  
    254                                             <td valign="top">  
    255                                                 <asp:CheckBoxList ID="cblARStatus" runat="server" CssClass="bluetextbold" RepeatColumns="1" Width="118px">  
    256                                                     <asp:ListItem Value="2">Missing</asp:ListItem> 
    257                                                     <asp:ListItem Value="3">Pending</asp:ListItem> 
    258                                                     <asp:ListItem Value="6">Complete</asp:ListItem> 
    259                                                 </asp:CheckBoxList></td>  
    260                                         </tr> 
    261                                     </table> 
    262                                 </td> 
    263                                 <td colspan="1" align="left">  
    264                                     <table style="width: 400px">  
    265                                         <tr> 
    266                                             <td> 
    267                                     <asp:Label ID="Label1" runat="server" CssClass="bluetextbold" Text="Original Ticket #:" 
    268                                         Width="100px"></asp:Label> 
    269                                     <asp:TextBox ID="txtOriginalTicket" runat="server"></asp:TextBox></td>  
    270                                         </tr> 
    271                                         <tr> 
    272                                             <td> 
    273                                     <asp:Label ID="Label4" runat="server" CssClass="bluetextbold" Text="Customer Invoice #:" 
    274                                         Width="117px"></asp:Label> 
    275                                     <asp:TextBox ID="txtCustInvoice" runat="server"></asp:TextBox></td>  
    276                                         </tr> 
    277                                         <tr> 
    278                                             <td> 
    279                                     <asp:Label ID="lblELMCheck" runat="server" CssClass="bluetextbold" Text="Check #"></asp:Label> 
    280                                     <asp:TextBox ID="txtCheckNum" runat="server"></asp:TextBox></td>  
    281                                         </tr> 
    282                                     </table> 
    283                                 </td> 
    284                             </tr> 
    285                             <tr> 
    286                                 <td align="center" colSpan="2"><ASP:LABEL id="LblSearchResults" RUNAT="server" CSSCLASS="bluetext"></ASP:LABEL></td>  
    287                             </tr> 
    288                         </table> 
    289                         <telerik:RadGrid ID="gridDamage" runat="server" AutoGenerateColumns="False" GridLines="None" 
    290                             Skin="Web20" AllowPaging="True" AllowSorting="True" OnItemCommand="gridDamage_ItemCommand" OnNeedDataSource="gridDamage_NeedDataSource">  
    291                             <ExportSettings> 
    292                                 <Pdf FontType="Subset" PaperSize="Letter" /> 
    293                                 <Excel Format="Html" /> 
    294                             </ExportSettings> 
    295                             <MasterTableView CommandItemDisplay="None" CurrentResetPageIndexAction="SetPageIndexToFirst" 
    296                                 Dir="LTR" Frame="Border" TableLayout="Auto" PageSize="30">  
    297                                 <EditFormSettings> 
    298                                     <EditColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType">  
    299                                     </EditColumn> 
    300                                 </EditFormSettings> 
    301                                 <Columns> 
    302                                     <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" 
    303                                         ForceExtractValue="None" HeaderText="Damage Date" UniqueName="DamageDate" DataType="System.DateTime" DataField="DamageDate" DataFormatString="{0:MM/dd/yyyy}">  
    304                                     </telerik:GridBoundColumn> 
    305                                     <telerik:GridButtonColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" 
    306                                         HeaderText="Damage" UniqueName="DamageNumber" DataTextField="OCLVerifyID" DataType="System.Int32" AutoPostBackOnFilter="True" CommandName="GetDetail" CommandArgument="OCLVerifyID">  
    307                                     </telerik:GridButtonColumn> 
    308                                     <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" 
    309                                         ForceExtractValue="None" HeaderText="Ticket" UniqueName="TicketNumber" DataField="TicketNumber">  
    310                                     </telerik:GridBoundColumn> 
    311                                     <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" 
    312                                         ForceExtractValue="None" HeaderText="Damage Address" UniqueName="DamageAddress" DataField="DamageAddress">  
    313                                     </telerik:GridBoundColumn> 
    314                                     <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" 
    315                                         ForceExtractValue="None" HeaderText="City" UniqueName="City" DataField="DamageCity">  
    316                                     </telerik:GridBoundColumn> 
    317                                     <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" 
    318                                         ForceExtractValue="None" HeaderText="State" UniqueName="State" DataField="DamageState">  
    319                                     </telerik:GridBoundColumn> 
    320                                     <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" 
    321                                         ForceExtractValue="None" HeaderText="Utility" UniqueName="Utility" DataField="UtilityCompany">  
    322                                     </telerik:GridBoundColumn> 
    323                                     <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" 
    324                                         ForceExtractValue="None" HeaderText="Line Size" UniqueName="LineSize" DataField="LineSize">  
    325                                     </telerik:GridBoundColumn> 
    326                                     <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" 
    327                                         ForceExtractValue="None" HeaderText="Status" UniqueName="Status" DataField="Status">  
    328                                     </telerik:GridBoundColumn> 
    329                                     <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" 
    330                                         ForceExtractValue="None" HeaderText="Liable" UniqueName="Liable" DataField="Liable">  
    331                                     </telerik:GridBoundColumn> 
    332                                     <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" 
    333                                         ForceExtractValue="None" HeaderText="Locator" UniqueName="Locator" DataField="Locator">  
    334                                     </telerik:GridBoundColumn> 
    335                                     <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="OCLVerifyID" 
    336                                         FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="OCLVerifyID" 
    337                                         UniqueName="OCLVerifyID" Visible="False">  
    338                                     </telerik:GridBoundColumn> 
    339                                 </Columns> 
    340                                 <ExpandCollapseColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" 
    341                                     Resizable="False" Visible="False">  
    342                                     <HeaderStyle Width="20px" /> 
    343                                 </ExpandCollapseColumn> 
    344                                 <RowIndicatorColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" 
    345                                     Visible="False">  
    346                                     <HeaderStyle Width="20px" /> 
    347                                 </RowIndicatorColumn> 
    348                             </MasterTableView> 
    349                             <GroupPanel ID="GroupPanel" Style="width: 100%;">  
    350                             </GroupPanel> 
    351                             <ClientSettings EnablePostBackOnRowClick="True">  
    352                                 <Selecting AllowRowSelect="True" /> 
    353                             </ClientSettings> 
    354                         </telerik:RadGrid><BR class="smalltext">  
    355                         <!-- End Main Page Content --></td>  
    356                 </tr> 
    357             </table> 
    358         </form> 
    359         <layout:defaultfooter id="FooterControl" runat="server"></layout:defaultfooter> 
    360     </body> 
    361 </HTML> 
    362  

    Here is the code behind

    1 using System;  
    2 using System.Collections;  
    3 using System.ComponentModel;  
    4 using System.Data;  
    5 using System.Drawing;  
    6 using System.Web;  
    7 using System.Web.SessionState;  
    8 using System.Web.UI;  
    9 using System.Web.UI.WebControls;  
    10 using System.Web.UI.HtmlControls;  
    11 using System.Configuration;  
    12 using System.Xml;  
    13 using ELM.TicketManagementSystem.bll;  
    14 using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;  
    15 using Telerik.Web.UI;  
    16  
    17 namespace ELM.TicketManagementSystem  
    18 {
    19     #region class DamageSearch  
    20     /// <summary>  
    21     /// Summary description for DamageSearch.  
    22     /// </summary>  
    23     public partial class DamageSearchForm : SecurePage  
    24     {
    25         #region declarations  
    26  
    27         // Privates  
    28  
    29         #endregion declarations
    30
    31         #region Page_Load  
    32         protected void Page_Load(object sender, System.EventArgs e)  
    33         {  
    34           
    35             if(!(IsPostBack))  
    36             {  
    37                 LoadDropDowns();  
    38                 //this.gridDamage.Visible = false;  
    39  
    40                 this.dateStart.SelectedDate = System.DateTime.Now.AddDays(-7);  
    41                 this.dateEnd.SelectedDate = System.DateTime.Now;  
    42             }             
    43         }
    44         #endregion Page_Load  
    45  
    46         #region Web Form Designer generated code  
    47         override protected void OnInit(EventArgs e)  
    48         {  
    49             //  
    50             // CODEGEN: This call is required by the ASP.NET Web Form Designer.  
    51             //  
    52             InitializeComponent();  
    53             base.OnInit(e);  
    54         }  
    55           
    56         /// <summary>  
    57         /// Required method for Designer support - do not modify  
    58         /// the contents of this method with the code editor.  
    59         /// </summary>  
    60         private void InitializeComponent()  
    61         {      
    62  
    63         }
    64         #endregion  
    65  
    66         protected void btnSearch_Click(object sender, EventArgs e)  
    67         {  
    68  
    69             if (rbLocation.Checked == true)  
    70             {  
    71                 //custom fields  
    72                 DataSet dsSearch = new DataSet();  
    73  
    74                 DateTime dStart = ELM.Common.Utility.SafeDate("1/01/1900");  
    75                 DateTime dEnd = ELM.Common.Utility.SafeDate("1/01/1900");  
    76                 string sLiable = "";  
    77                 string sARStatus = "";  
    78                 string sDamageStatus = "";  
    79                 string sState = "";  
    80                 string sLocator = "";  
    81  
    82                 if (dateStart.SelectedDate != null)  
    83                 {  
    84                     dStart = ELM.Common.Utility.SafeDate(dateStart.SelectedDate);  
    85                 }  
    86                 if (dateEnd.SelectedDate != null)  
    87                 {  
    88                     dEnd = ELM.Common.Utility.SafeDate(dateEnd.SelectedDate);  
    89                 }  
    90                 if (ddlLocator.SelectedIndex >= 1)  
    91                 {  
    92                     sLocator = ddlLocator.SelectedValue.ToString();  
    93                 }  
    94                 if (ddlState.SelectedIndex >= 1)  
    95                 {  
    96                     sState = ddlState.SelectedValue.ToString();  
    97                 }  
    98  
    99  
    100                 foreach (ListItem item in cblARStatus.Items)  
    101                 {  
    102                     if(item.Selected == true)  
    103                     {  
    104                         if (sARStatus != "")  
    105                         {  
    106                             sARStatus += ",";  
    107                         }  
    108                         sARStatus += item.Value.ToString();  
    109                     }  
    110                 }  
    111                 foreach (ListItem item in cblLiable.Items)  
    112                 {  
    113                     if(item.Selected == true)  
    114                     {  
    115                         if (sLiable != "")  
    116                         {  
    117                             sLiable += ",";  
    118                         }  
    119                         sLiable += item.Value.ToString();  
    120                     }  
    121                 }  
    122                 foreach (ListItem item in cblStatus.Items)  
    123                 {  
    124                     if(item.Selected == true)  
    125                     {  
    126                         if (sDamageStatus != "")  
    127                         {  
    128                             sDamageStatus += ",";  
    129                         }  
    130                         sDamageStatus += item.Value.ToString();  
    131                     }  
    132                 }  
    133  
    134                 dsSearch = DamageDetail.GetDamageSearchCustom(dStart, dEnd, txtDamageAddress.Text, txtCity.Text, sState, txtOriginalTicket.Text, sLocator, sLiable, txtCustInvoice.Text, sARStatus, sDamageStatus, txtCheckNum.Text, drpProfitCenters.SelectedValue, User.Identity.Name.ToString(),chkSearchAll.Checked);   
    135                 if (dsSearch.Tables[0].Rows.Count == 0)  
    136                 {  
    137                     this.LblSearchResults.Text = "No Results Found";  
    138                     this.LblSearchResults.Visible = true;  
    139                 }  
    140                 else 
    141                 {  
    142                     this.LblSearchResults.Text = ELM.Common.Utility.SafeString(dsSearch.Tables[0].Rows.Count) + " Results Found";  
    143                     this.LblSearchResults.Visible = true;  
    144                     gridDamage.DataSource = dsSearch.Tables[0];  
    145                     gridDamage.DataBind();  
    146                 }  
    147             }  
    148             if (rbDamage.Checked == true)  
    149             {  
    150                 //damage number  
    151                 DataSet dsSearch = new DataSet();  
    152                 dsSearch = DamageDetail.GetDamageSearchByDamageNumber(ELM.Common.Utility.SafeInt(txtDamage.Text));  
    153                 if (dsSearch.Tables[0].Rows.Count == 0)  
    154                 {  
    155                     this.LblSearchResults.Text = "No Results Found";  
    156                     this.LblSearchResults.Visible = true;  
    157                 }  
    158                 else 
    159                 {  
    160                     this.LblSearchResults.Text = ELM.Common.Utility.SafeString(dsSearch.Tables[0].Rows.Count) + " Results Found";  
    161                     this.LblSearchResults.Visible = true;  
    162                     gridDamage.DataSource = dsSearch.Tables[0];  
    163                     gridDamage.DataBind();  
    164                 }  
    165             }  
    166  
    167         }  
    168  
    169         protected void btnNewDamage_Click(object sender, EventArgs e)  
    170         {  
    171             Session["oclVerifyID"] = "0";  
    172             Response.Redirect("DamageDetailEdit.aspx");  
    173         }  
    174  
    175         public void initDropDownLists()  
    176         {  
    177             // Instantiate Proxy  
    178             //userWS ws = new userWS();  
    179             //DataSet stateListDS = new DataSet();  
    180  
    181  
    182  
    183             //switch (SessionState.EmployeeIsWebAdmin)  
    184             //{  
    185             //    case 0:   // Get all states                                     
    186             //        stateListDS = ws.getState();  
    187             //        break;  
    188             //    default:  
    189             //        stateListDS = ws.getStateByEmployee(SessionState.CurrentEmployee.EmployeeID);  
    190             //        break;  
    191             //}  
    192             //ddStateList.DataSource = stateListDS.Tables["State"];  
    193             //ddStateList.DataValueField = stateListDS.Tables["State"].Columns["StateID"].ToString();  
    194             //ddStateList.DataTextField = stateListDS.Tables["State"].Columns["StateName"].ToString();  
    195             //ddStateList.DataBind();  
    196             //ddStateList.SelectedIndex = 0;  
    197  
    198             //ListItem defaultItem = new ListItem("  -- Select Profit Center --", "0");  
    199             //drpProfitCenters.Items.Add(defaultItem);  
    200             //drpProfitCenters.SelectedIndex = 0;  
    201         }  
    202  
    203         protected void gridDamage_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)  
    204         {  
    205             if (e.CommandName == "GetDetail")  
    206             {  
    207                 Session["oclVerifyID"] = (e.Item as GridDataItem)["OCLVerifyID"].Text;  
    208                 Response.Redirect("DamageDetailEdit.aspx");  
    209             }  
    210         }  
    211  
    212         protected void gridDamage_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
    213         {  
    214  
    215         }  
    216  
    217         private void LoadDropDowns()  
    218         {  
    219             // UtilityCompany  
    220             //UtilityCollection utilC = new UtilityCollection();  
    221             //utilC = Utility.GetUtilitiesActive(true);  
    222  
    223             CustomerCollection custC = new CustomerCollection();  
    224             custC = Customer.GetCustomers(true);  
    225  
    226               
    227             this.ddlUtility.DataSource = custC;  
    228             this.ddlUtility.AppendDataBoundItems = true;  
    229             ListItem li = new ListItem(" ""-1");  
    230             this.ddlUtility.Items.Add(li);  
    231             this.ddlUtility.DataTextField = "CustomerName";  
    232             this.ddlUtility.DataValueField = "CustomerID";  
    233             this.ddlUtility.DataBind();  
    234             this.ddlUtility.SelectedValue = "-1";  
    235  
    236             // State  
    237             StateCollection stateC = new StateCollection();  
    238             stateC = State.GetStates();  
    239  
    240             this.ddlState.DataSource = stateC;  
    241             this.ddlState.AppendDataBoundItems = true;  
    242             this.ddlState.Items.Add(li);  
    243             this.ddlState.DataTextField = "StateCode";  
    244             this.ddlState.DataValueField = "StateCode";  
    245             this.ddlState.DataBind();  
    246             this.ddlState.SelectedValue = "-1";  
    247  
    248             // NavState  
    249             StateCollection navstateC = new StateCollection();  
    250             navstateC = State.GetStates();  
    251  
    252             this.ddStateList.DataSource = navstateC;  
    253             this.ddStateList.AppendDataBoundItems = true;  
    254             this.ddStateList.Items.Add(li);  
    255             this.ddStateList.DataTextField = "StateCode";  
    256             this.ddStateList.DataValueField = "StateCode";  
    257             this.ddStateList.DataBind();  
    258             this.ddStateList.SelectedValue = "-1";  
    259  
    260  
    261             // Locator  
    262             DataSet dsE = new DataSet();  
    263             dsE = Employee.GetEmployeesActive();  
    264  
    265             this.ddlLocator.DataSource = dsE.Tables[0];  
    266             this.ddlLocator.AppendDataBoundItems = true;  
    267             this.ddlLocator.Items.Add(li);  
    268             this.ddlLocator.DataTextField = "EmployeeName";  
    269             this.ddlLocator.DataValueField = "EmployeeID";  
    270             this.ddlLocator.DataBind();  
    271             this.ddlLocator.SelectedValue = "-1";  
    272  
    273         }  
    274  
    275         protected void ddStateList_SelectedIndexChanged(object sender, EventArgs e)  
    276         {  
    277             // NavProfitCenter  
    278             ProfitCenterCollection pcC = new ProfitCenterCollection();  
    279             pcC = ProfitCenter.GetProfitCentersByState(ELM.Common.Utility.SafeInt(ddStateList.SelectedValue));  
    280             this.drpProfitCenters.DataSource = pcC;  
    281             this.drpProfitCenters.DataTextField = "ProfitCenterShortDesc";  
    282             this.drpProfitCenters.DataValueField = "ProfitCenterID";  
    283             this.drpProfitCenters.DataBind();  
    284             this.drpProfitCenters.Visible = true;  
    285         }  
    286  
    287         protected void rbLocation_CheckedChanged(object sender, EventArgs e)  
    288         {  
    289             if (this.rbLocation.Checked == true)  
    290             {  
    291                 chkSearchAll.Enabled = true;  
    292                 chkSearchAll.Checked = true;  
    293                 ddStateList.Enabled = false;  
    294                 drpProfitCenters.Visible = false;  
    295                 ddStateList.SelectedIndex = -1;  
    296                 drpProfitCenters.SelectedIndex = -1;  
    297                 txtDamage.Text = "";  
    298                 txtDamage.Visible = false;  
    299             }  
    300             else 
    301             {  
    302                 chkSearchAll.Enabled = false;  
    303                 ddStateList.Enabled = false;  
    304                 drpProfitCenters.Enabled = false;  
    305             }  
    306         }  
    307  
    308         protected void rbDamage_CheckedChanged(object sender, EventArgs e)  
    309         {  
    310             if (this.rbDamage.Checked == true)  
    311             {  
    312                 chkSearchAll.Enabled = false;  
    313                 ddStateList.Enabled = false;  
    314                 ddStateList.SelectedIndex = -1;  
    315                 drpProfitCenters.Enabled = false;  
    316                 drpProfitCenters.SelectedIndex = -1;  
    317                 drpProfitCenters.Visible = false;  
    318                 //txtDamage.Enabled = true;  
    319                 txtDamage.Visible = true;  
    320                 txtDamage.Text = "";  
    321             }  
    322             else 
    323             {  
    324                 //txtDamage.Enabled = false;  
    325                 txtDamage.Text = "";  
    326                 txtDamage.Visible = false;  
    327             }  
    328         }  
    329  
    330         protected void chkSearchAll_CheckedChanged(object sender, EventArgs e)  
    331         {  
    332             if (this.chkSearchAll.Checked == true)  
    333             {  
    334                 ddStateList.Enabled = false;  
    335                 drpProfitCenters.Visible = false;  
    336                 ddStateList.SelectedIndex = -1;  
    337                 drpProfitCenters.SelectedIndex = -1;  
    338             }  
    339             else 
    340             {  
    341                 ddStateList.Enabled = true;  
    342             }  
    343         } 

     

  2. Answer
    Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 20 Feb 2008 Link to this post

    Hello Doug,

    Unfortunately I was not able to run the provided code locally, due to some missing resources. We however noticed that you are not using the latest version of the Calendar control - Q3 SP1 (SP2 will be released on Monday). Please upgrade and see if that helps in your case. If the issue persists and if it is convenient for you, could you please open a regular support ticket and send us small runnable project, which replicates the described strange behaviour. We will test it on our side and advise you further.

    Regards,
    Maria Ilieva
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Doug Odegaard
    Doug Odegaard avatar
    52 posts
    Member since:
    Oct 2004

    Posted 22 Feb 2008 Link to this post

    that did the trick....much better.....thanks
Back to Top