Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
67 views
Hi 

If I set my theme as a page theme - Me.Page.Theme = "Black" in the preinit function of the code behind then I I end up with a treeview showing very odd results as shown in the attached image,  in the image the normal checked elements are actually unchecked and the raised checks are the elements with checks,  If I then remove the page level theming and set in the control it works as it should.

I've also tried setting the page theme to Forest and that one works as it should - it seems that the problematic theme is Black.

This has happened since installing the 2013 Q1 release.

Please could you advise if there is a global work around for this so I don't have to fix every page.  

Also please advise when it is likely that a fix will be in place in the internal builds.

Regards,

Jon

Jon
Top achievements
Rank 1
 answered on 13 Mar 2013
2 answers
414 views
Hi, I have a RadGrid with a detail table. I want to select row simultaneously which i  clicked to expand its detail.
Because I want to get a cell value of master grid's selected row. For example first cell named "ID"

kind regards. thanks

Yunus
Top achievements
Rank 1
 answered on 13 Mar 2013
1 answer
190 views

Requirements

RadControls version
.NET version
Visual Studio version
programming language
browser support

all browsers supported by RadControls


PROJECT DESCRIPTION
i have telerik editor issues with arabic language , when i typing in arbaic from right to left and then i press space key control shifted to
right of text , how i can solve this issue .

here is my code :
 <telerik:radeditor saveinfile="true" OnClientSubmit="OnClientSubmit"
                                       direction="rtl" style="width: 590px; direction: rtl;
                                text-align: right" enableembeddedskins="true" id="RadEditor1" onclientload="EditerTabindex" OnClientCommandExecuting="OnClientCommandExecuting"
                                runat="server" editmodes="Design, Preview,html" newlinebr="false"  stripformattingonpaste="Span,MSWordRemoveAll">
                               <ClientEvents OnKeyPress="AlphabetOnly" />
                                         <CssFiles>
                                         <telerik:EditorCssFile Value="../Template/Resources/css/Editor.css" />
                                         </CssFiles>
                                                                      <Tools>
                            <telerik:EditorToolGroup Tag="NewGroup">
                             
                                    <telerik:EditorTool Name="Cut"   />
                                <telerik:EditorTool Name="Copy" />
                                <telerik:EditorTool Name="Paste" />
                                  <telerik:EditorTool Name="Underline" />
                                <telerik:EditorTool Name="Bold" />
                                       <telerik:EditorTool Name="Italic" />
                                <telerik:EditorTool Name="FontName"  />
                                <%--<telerik:EditorTool Name="FontSize"/>--%>
                                 <telerik:EditorTool Name="RealFontSize" Text="Size" />
                                <telerik:EditorTool  Name="ForeColor"  />
                                
                      <telerik:EditorTool Name="BackColor" />
                                
                                  <telerik:EditorTool Name="RTL" />
                                 <telerik:EditorTool Name="InsertUnorderedList" />
                                 <telerik:EditorTool Name="InsertOrderedList" />
                                
                                 
                                 <telerik:EditorTool Name="Redo" />
                                  <telerik:EditorTool Name="Undo" />
                                 
</telerik:EditorToolGroup>
</Tools>
                                    
                                     <Content>
</Content>
                                 
                                    
                                 </telerik:radeditor>


javascript :

  <script type="text/javascript">
           function OnClientSubmit(editor) {
               editor.set_html(Telerik.Web.UI.Editor.Utils.convertWordLists(editor.get_html()));
               editor.fire("FormatStripper", { value: "WORD_ALL" });

               //            alert(editor.get_html(true));
           }
           function EditerTabindex(editor) {

               editor.get_document().body.style.textAlign = "right";
               editor.removeShortCut("InsertTab");
               var iframe = editor.get_contentAreaElement();
               iframe.setAttribute("tabIndex", "2");
               iframe.setAttribute("Direction", "rtl");
               var buttonsHolder = $get(editor.get_id() + "Top");
               var buttons = buttonsHolder.getElementsByTagName("A");
               for (var i = 0; i < buttons.length; i++) {
                   var a = buttons[i];
                   a.tabIndex = -1;
                   a.tabStop = false;
                   //alert("fdgdfg");
               }

           }
    </script>
 <script type="text/javascript">
     function OnClientCommandExecuting(editor, args) {
         var name = args.get_name();
         var val = args.get_value();
         if (name == "Paste") {
             editor.fire("PastePlainText");
             args.set_cancel(true);
         }
     }

     function AlphabetOnly(sender, eventArgs) {
         var c = eventArgs.get_keyCode();
         if ((c < 65) || (c > 90 && c < 97) || (c > 122))
             eventArgs.set_cancel(true);
     }
  </script>
Rumen
Telerik team
 answered on 13 Mar 2013
11 answers
234 views
I have a weird problem that I hope you can help with.  I have a number of radComboboxes on a page all with LoadOnDemand enabled via webservice.  Everything works find except that when a postback occurs on my first combobox, I can no longer use backspace to remove characters from the Text of the combobox.  Instead it takes me back a page in the browser history.  If I turn the AutoPostback OFF, then I can edit the Text all day.  Any ideas?
Here is my code:
<%@ Page Title="Quick Entry" Language="VB" MasterPageFile="~/AIR.master" AutoEventWireup="false" CodeFile="quick_report.aspx.vb" Inherits="quick_report" %>
  
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
  
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
  
    <script type="text/javascript">
        function OnClientItemsRequestingHandler(sender, eventArgs) {
            var context = eventArgs.get_context();
            var hiddenField = document.getElementById("<%= hidEmpLocation.ClientID %>");
   
            context["FilterValue"] = hiddenField.value;
        }
  
        function show_vehicle_involved_help() {
            var oWnd = $find("<%=winItem3.ClientID %>");
            oWnd.set_height(500);
            oWnd.setUrl('vehicle_involved_help.htm');
            oWnd.show();
        }
  
        function open_password() {
            var oWnd = $find("<%=winItem3.ClientID %>");
            oWnd.set_height(200);
            oWnd.setUrl('change_password.aspx');
            oWnd.show();
        }
  
        function set_data_changed() {
            var myHidDC = document.getElementById("<%= hidDataChanged.ClientID %>")
                myHidDC.value = "1";
        }
  
        function check_data_changed() {
            var myHidDC = document.getElementById("<%= hidDataChanged.ClientID %>")
            if (myHidDC.value == "1") {
                return confirm('Discard changes?');
            } else {
                return true;
            }
        }
  
        function set_dtofaccident_focus(sender, eventArgs) {
            var myD = $find("<%=txtDateOfAccident.DateInput.ClientID%>");
            if (myD != null) {
                myD.focus();
            }
        }
  
        function set_dtreported_focus(sender, eventArgs) {
            var myD = $find("<%=txtDateReported.DateInput.ClientID%>");
            if (myD != null) {
                myD.focus();
            }
        }
  
        function show_severity_help() {
            var oWnd = $find("<%=winItem3.ClientID %>");
            oWnd.set_height(500);
            oWnd.setUrl('severity_help.htm');
            oWnd.show();
            //radopen("severity_help.htm","HELP");
        }
  
        function show_item3_help() {
            var oWnd = $find("<%=winItem3.ClientID %>");
            oWnd.set_height(250);
            oWnd.setUrl('item3_help.htm');
            oWnd.show();
            //radopen("item3_help.htm", "winItem3");
        }
  
        function radpopup(msg) {
            var win = radalert(msg);
            win.add_close(function() {
                window.location = 'quick_report.aspx?userid=<%=Session("userid") %>';
            });
        }
    </script>
    <style type="text/css">
        .readonly
        {
            color: Maroon;
        }
  
        .tbl_left 
        {
            width: 30%;
            text-align: right;
            vertical-align:top;    
        }
  
        .tbl_right 
        {
            width: 70%;
            text-align: left;
            vertical-align:top;    
        }
     
        .tbl_middle
        {
            width: 70%;
            text-align: left;
            vertical-align:top;    
        }
  
    .RadPicker
    {
        vertical-align:middle;
    }
  
    .RadPicker .rcTable
    {
        table-layout:auto;
    }
  
    .RadPicker .RadInput
    {
        vertical-align:baseline;
    }
  
   .RadInput
    {
        vertical-align:middle;
    }
  
    .RadInput_Default
    {
        font:12px "segoe ui",arial,sans-serif;
    }
  
    .RadPicker .rcCalPopup
    {
        display:block;
        overflow:hidden;
        width:22px;
        height:22px;
        background-color:transparent;
        background-repeat:no-repeat;
        text-indent:-2222px;
        text-align:center;
    }
          
    .RadPicker_Default .rcCalPopup
    {
        background-image:url('mvwres://Telerik.Web.UI, Version=2010.1.309.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4/Telerik.Web.UI.Skins.Default.Calendar.sprite.gif');
    }
  
    .RadPicker_Default .rcCalPopup
    {
        background-position:0 0;
    }
  
    .style1
    {
        width: 70%;
        text-align: left;
        vertical-align: top;
        font-weight: bold;
    }
  
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MenuBar" Runat="Server">
    <asp:LinkButton ID="cmdChangePassword" runat="server" Visible="true" OnClientClick="open_password(); return false;">Change Password</asp:LinkButton>
    <telerik:RadWindow runat="server" ID="winItem3" Height="2px" Width="800px" OffsetElementID=""
        Modal="true" Behaviors="Close" EnableShadow="true" VisibleStatusbar="false">
    </telerik:RadWindow>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Header" Runat="Server">
    </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Body" Runat="Server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" height="100%" 
        width="100%">
    <asp:UpdatePanel ID="UP1" runat="server">
        <ContentTemplate>
            <asp:HiddenField ID="hidDataChanged" runat="server" Value="0" />
            <asp:HiddenField ID="hidCallerTitleId" runat="server" Value="0" />
            <asp:HiddenField ID="hidEmpLocation" runat="server" Value="0" />
            <table style="width:100%; text-align:center; vertical-align:top;">
                <tr>
                    <td class="tbl_left" 
                        style="text-align:left; color: #FF0000; font-weight: bold;">
                        * = required fields</td>
                    <td width="35%" style="text-align:left;">
                        <b><asp:Literal runat="server" ID="qe_item1"></asp:Literal></b></td>
                </tr>
                <tr>
                    <td class="tbl_left" style="text-align:left;">
                         </td>
                    <td width="35%" style="text-align: left;">
                        <b>
                            <asp:Literal runat="server" ID="qe_item2"></asp:Literal></b>
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left" style="text-align:left;">
                         </td>
                    <td width="35%" style="text-align: left;">
                        <asp:Label ID="lblItem3" runat="server" style="font-weight: 700" 
                            Text="3. Was there a fatality involved or other serious incident ( Follow SOP 3-017 ) ?" 
                            ToolTip=""></asp:Label>
                         <asp:ImageButton ID="imgItem3Help" runat="server" ImageAlign="Middle" 
                            ImageUrl="~/Images/help2.png" OnClientClick="show_item3_help()" 
                            ToolTip="Help" />
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left" style="text-align:left;">
                         </td>
                    <td class="tbl_middle">
                        <asp:Button ID="cmdSubmitTop" runat="server" Text="Submit" />
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                         </td>
                    <td class="tbl_middle" style="font-weight: bold">
                        What is your GSN?</td>
                </tr>
                <tr>
                    <td class="tbl_left">
                        <span style="color: #FF0000">* </span>Caller's GSN:</td>
                    <td class="tbl_middle">
                        <telerik:RadComboBox ID="cboCallersGSN" Runat="server" 
                            EnableLoadOnDemand="True" EnableVirtualScrolling="True" 
                            ShowMoreResultsBox="True" ForeColor="Maroon" MarkFirstMatch="True" 
                            TabIndex="1" AutoPostBack="True">
                            <WebServiceSettings Method="Get_Caller_GSN" Path="DPSG_Data.asmx" />
                        </telerik:RadComboBox>
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                         </td>
                    <td class="tbl_middle" style="font-weight: bold">
                        What is your name?</td>
                </tr>
                <tr>
                    <td class="tbl_left">
                        <span style="color: #FF0000">* </span>Caller's Name:</td>
                    <td class="tbl_middle">
                        <asp:TextBox ID="txtCallerName" runat="server" Width="200px" ReadOnly="True" 
                            CssClass="readonly" TabIndex="1"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                         </td>
                    <td class="tbl_middle" style="font-weight: bold">
                        What is your title?</td>
                </tr>
                <tr>
                    <td class="tbl_left">
                        <span style="color: #FF0000">* </span>Caller's Title:</td>
                    <td class="tbl_middle">
                        <asp:TextBox ID="txtCallerTitle" runat="server" CssClass="readonly" 
                            TabIndex="1" Width="300px" ReadOnly="True"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                         </td>
                    <td class="tbl_middle" style="font-weight: bold">
                        What is your best contact phone number?</td>
                </tr>
                <tr>
                    <td class="tbl_left">
                        <span style="color: #FF0000">* </span>Caller's Phone #:</td>
                    <td class="tbl_middle">
                        <telerik:RadMaskedTextBox ID="txtCallerPhone" runat="server" LabelCssClass="" 
                            Mask="(###) ###-####" TabIndex="1" TextWithLiterals="() -" Width="80px" 
                            ForeColor="Maroon">
                        </telerik:RadMaskedTextBox>
                         Ext:
                        <telerik:RadMaskedTextBox ID="txtCallerExt" runat="server" LabelCssClass="" 
                            Mask="###-####" TabIndex="1" TextWithLiterals="" Width="50px" 
                            ForeColor="Maroon">
                        </telerik:RadMaskedTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                         </td>
                    <td class="tbl_middle">
                        <b>What is your e-mail address?</b
                        <br />
                        <i>Please have the caller spell out and repeat back to ensure it is correct.</i></td>
                </tr>
                <tr>
                    <td class="tbl_left">
                        <span style="color: #FF0000">* </span>Caller's E-Mail:</td>
                    <td class="tbl_middle">
                        <asp:TextBox ID="txtCallerEMail" runat="server" TabIndex="1" width="300px" 
                            CssClass="readonly" ReadOnly="True"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                         </td>
                    <td class="style1">
                        Was the person involved a DPSG employee?</td>
                </tr>
                <tr>
                    <td class="tbl_left">
                        DPSG Employee?</td>
                    <td class="tbl_middle">
                        <asp:RadioButtonList ID="opgDPSGEmployee" runat="server" AutoPostBack="True" 
                            RepeatDirection="Horizontal" RepeatLayout="Flow" TabIndex="1" 
                            ForeColor="Maroon">
                            <asp:ListItem Selected="True" Value="1">Yes</asp:ListItem>
                            <asp:ListItem Value="0">No</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                         </td>
                    <td class="tbl_middle">
                        <b>Who was the person involved?</b><br />
                        <span style="font-weight: normal; font-style: italic">Please say and spell the 
                        first and last name.</span></td>
                </tr>
                <tr>
                    <td class="tbl_left">
                        <span style="color: #FF0000">* </span>Name of Person Involved:</td>
                    <td class="tbl_middle">
                        <telerik:RadComboBox ID="cboPersonInvolved" Runat="server" 
                            TabIndex="1" ShowMoreResultsBox="true" EnableVirtualScrolling="true" 
                            EnableLoadOnDemand="True" ForeColor="Maroon" AutoPostBack="True">
                            <WebServiceSettings Method="Get_Employees" Path="DPSG_Data.asmx" />
                        </telerik:RadComboBox>
                        <asp:TextBox ID="txtPersonInvolved" runat="server" TabIndex="1" Visible="False" 
                            Width="300px" ForeColor="Maroon"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                         </td>
                    <td class="tbl_middle" style="font-weight: bold">
                        What is the person's best contact phone number?</td>
                </tr>
                <tr>
                    <td class="tbl_left">
                        Person's Phone #:</td>
                    <td class="tbl_middle">
                        <telerik:RadMaskedTextBox ID="txtEmpPhone" runat="server" LabelCssClass="" 
                            Mask="(###) ###-####" TabIndex="1" TextWithLiterals="() -" Width="80px" 
                            ForeColor="Maroon">
                        </telerik:RadMaskedTextBox>
                         Ext:
                        <telerik:RadMaskedTextBox ID="txtEmpExt" runat="server" LabelCssClass="" 
                            Mask="###-####" TabIndex="1" TextWithLiterals="" Width="50px" 
                            ForeColor="Maroon">
                        </telerik:RadMaskedTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                         </td>
                    <td class="tbl_middle" style="font-weight: bold">
                        At which DPSG location or site does this person report to?</td>
                </tr>
                <tr>
                    <td class="tbl_left">
                            <span style="color: #FF0000">* </span>Location/Site:</td>
                    <td class="tbl_middle">
                        <telerik:RadComboBox ID="cboLocation" Runat="server" 
                            TabIndex="1" ShowMoreResultsBox="true" EnableVirtualScrolling="true" 
                            EnableLoadOnDemand="True" ForeColor="Maroon" OnClientItemsRequesting="OnClientItemsRequestingHandler">
                            <WebServiceSettings Method="Get_Caller_Location" Path="DPSG_Data.asmx" />
                        </telerik:RadComboBox>
                        <asp:Label ID="lblNA" runat="server" ForeColor="Maroon" Text="N/A" 
                            Visible="False"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                         </td>
                    <td class="tbl_middle" style="font-weight: bold">
                        When did this incident occur, date & time?</td>
                </tr>
                <tr>
                    <td class="tbl_left">
                        <span style="color: #FF0000">* </span>Date of Incident:</td>
                    <td class="tbl_middle">
                        <telerik:RadDatePicker ID="txtDateOfAccident" runat="server" 
                            Culture="English (United States)" TabIndex="1" Width="100px" 
                            ForeColor="Maroon">
                            <Calendar ShowRowHeaders="False" UseColumnHeadersAsSelectors="False" 
                                UseRowHeadersAsSelectors="False" ViewSelectorText="x">
                            </Calendar>
                            <DateInput DateFormat="MM/dd/yyyy" DisplayDateFormat="MM/dd/yyyy" 
                                LabelCssClass="" TabIndex="1" Width="" forecolor="Maroon">
                            </DateInput>
                            <DatePopupButton CssClass="" HoverImageUrl="" ImageUrl="" TabIndex="9999" />
                            <ClientEvents OnPopupClosing="set_dtofaccident_focus" />
                        </telerik:RadDatePicker>
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                        <span style="color: #FF0000">* </span>Time of Incident:</td>
                    <td class="tbl_middle">
                        <telerik:RadTimePicker ID="txtTimeOfAccident" runat="server" 
                            Culture="English (United States)" TabIndex="1" Width="80px" 
                            ForeColor="Maroon">
                            <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" 
                                ViewSelectorText="x">
                            </Calendar>
                            <DatePopupButton CssClass="" HoverImageUrl="" ImageUrl="" TabIndex="1" 
                                Visible="False" />
                            <TimeView CellSpacing="-1">
                            </TimeView>
                            <TimePopupButton CssClass="" HoverImageUrl="" ImageUrl="" />
                            <DateInput DateFormat="hh:mm tt" DisplayDateFormat="hh:mm tt" LabelCssClass="" 
                                TabIndex="1" Width="" forecolor="Maroon">
                            </DateInput>
                        </telerik:RadTimePicker>
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                         </td>
                    <td class="tbl_middle" style="font-weight: bold">
                        Where did this incident occur?</td>
                </tr>
                <tr>
                    <td class="tbl_left">
                        <span style="color: #FF0000">* </span>Place of Incident:</td>
                    <td class="tbl_middle">
                        <asp:TextBox ID="txtPlaceOfAccident" runat="server" TabIndex="1" Width="300px" 
                            ForeColor="Maroon"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                         </td>
                    <td class="tbl_middle" style="font-weight: bold">
                        When was this incident reported to you, date & time?</td>
                </tr>
                <tr>
                    <td class="tbl_left">
                        <span style="color: #FF0000">* </span>Date Reported:</td>
                    <td class="tbl_middle">
                        <telerik:RadDatePicker ID="txtDateReported" runat="server" 
                            Culture="English (United States)" TabIndex="1" Width="100px" 
                            ForeColor="Maroon">
                            <Calendar ShowRowHeaders="False" UseColumnHeadersAsSelectors="False" 
                                UseRowHeadersAsSelectors="False" ViewSelectorText="x">
                            </Calendar>
                            <DateInput DateFormat="MM/dd/yyyy" DisplayDateFormat="MM/dd/yyyy" 
                                LabelCssClass="" TabIndex="1" Width="" forecolor="Maroon">
                            </DateInput>
                            <DatePopupButton CssClass="" HoverImageUrl="" ImageUrl="" TabIndex="9999" />
                            <ClientEvents OnPopupClosing="set_dtreported_focus" />
                        </telerik:RadDatePicker>
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                        <span style="color: #FF0000">* </span>Time Reported:</td>
                    <td class="tbl_middle">
                        <telerik:RadTimePicker ID="txtTimeReported" runat="server" 
                            Culture="English (United States)" TabIndex="1" Width="80px" 
                            ForeColor="Maroon">
                            <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" 
                                ViewSelectorText="x">
                            </Calendar>
                            <DatePopupButton CssClass="" HoverImageUrl="" ImageUrl="" TabIndex="1" 
                                Visible="False" />
                            <TimeView CellSpacing="-1">
                            </TimeView>
                            <TimePopupButton CssClass="" HoverImageUrl="" ImageUrl="" />
                            <DateInput DateFormat="hh:mm tt" DisplayDateFormat="hh:mm tt" LabelCssClass="" 
                                TabIndex="1" Width="" forecolor="Maroon">
                            </DateInput>
                        </telerik:RadTimePicker>
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                         </td>
                    <td class="tbl_middle" style="font-weight: bold">
                        Was the person injured?</td>
                </tr>
                <tr>
                    <td class="tbl_left">
                        <span style="color: #FF0000">* </span>Is Injury Involved?</td>
                    <td class="tbl_middle">
                        <asp:RadioButtonList ID="opgInjury" runat="server" AutoPostBack="True" 
                            RepeatDirection="Horizontal" RepeatLayout="Flow" TabIndex="1" 
                            ForeColor="Maroon">
                            <asp:ListItem Value="1">Yes</asp:ListItem>
                            <asp:ListItem Value="0">No</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                        <span style="color: #FF0000">* </span>Severity:</td>
                    <td class="tbl_middle">
                        <asp:DropDownList ID="cboSeverity" runat="server" AutoPostBack="True" 
                            TabIndex="1" ForeColor="Maroon">
                        </asp:DropDownList>
                         <asp:ImageButton ID="imgHelp" runat="server" ImageAlign="Middle" 
                            ImageUrl="~/Images/help2.png" OnClientClick="show_severity_help()" />
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                         </td>
                    <td class="tbl_middle" style="font-weight: bold">
                        Was a company owned or leased vehicle involved?</td>
                </tr>
                <tr>
                    <td class="tbl_left">
                        <span style="color: #FF0000">* </span>Was Vehicle Involved?</td>
                    <td class="tbl_middle">
                        <asp:RadioButtonList ID="opgVehicle" runat="server" AutoPostBack="True" 
                            RepeatDirection="Horizontal" RepeatLayout="Flow" TabIndex="1" 
                            ForeColor="Maroon">
                            <asp:ListItem Value="1">Yes</asp:ListItem>
                            <asp:ListItem Value="0">No</asp:ListItem>
                        </asp:RadioButtonList>
                         <asp:ImageButton ID="imgHelpVehicleInvolved" runat="server" 
                            ImageAlign="Middle" ImageUrl="~/Images/help2.png" 
                            OnClientClick="show_vehicle_involved_help()" />
                    </td>
                </tr>
            </table>
            <asp:Panel runat="server" ID="pnlT3" Visible="False">
                <table ID="table1" 
                    style="width: 100%; text-align: center; vertical-align: top;">
                    <tr>
                        <td class="tbl_left">
                             </td>
                        <td class="tbl_middle" style="font-weight: bold">
                            Was any vehicle towed from the scene of the accident?</td>
                        <td class="tbl_right" style="font-weight: bold">
                             </td>
                    </tr>
                    <tr>
                        <td class="tbl_left">
                            <span style="color: #FF0000">* </span>Vehicle Towed?</td>
                        <td class="tbl_middle">
                            <asp:RadioButtonList ID="opgVehicleTowed" runat="server" AutoPostBack="True" 
                                RepeatDirection="Horizontal" RepeatLayout="Flow" TabIndex="1">
                                <asp:ListItem Value="1">Yes</asp:ListItem>
                                <asp:ListItem Value="0">No</asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                        <td class="tbl_right" style="font-weight: bold">
                             </td>
                    </tr>
                    <tr>
                        <td class="tbl_left">
                             </td>
                        <td class="tbl_middle" style="font-weight: bold">
                            Was any medical treatment required or provided away from the scene of the 
                            accident?</td>
                        <td class="tbl_right" style="font-weight: bold">
                             </td>
                    </tr>
                    <tr>
                        <td class="tbl_left">
                            <span style="color: #FF0000">* </span>Medical Away from Scene?</td>
                        <td class="tbl_middle">
                            <asp:RadioButtonList ID="opgMedicalAway" runat="server" AutoPostBack="True" 
                                RepeatDirection="Horizontal" RepeatLayout="Flow" TabIndex="1">
                                <asp:ListItem Value="1">Yes</asp:ListItem>
                                <asp:ListItem Value="0">No</asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                        <td class="tbl_right" style="font-weight: bold">
                             </td>
                    </tr>
                    <tr>
                        <td class="tbl_left">
                            <span style="color: #FF0000">* </span>Other?</td>
                        <td class="tbl_middle">
                            <asp:RadioButtonList ID="opgOther" runat="server" AutoPostBack="True" 
                                RepeatDirection="Horizontal" RepeatLayout="Flow" TabIndex="1">
                                <asp:ListItem Value="1">Yes</asp:ListItem>
                                <asp:ListItem Value="0">No</asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                        <td class="tbl_right" style="font-weight: bold">
                             </td>
                    </tr>
                    <tr>
                        <td class="tbl_left">
                             </td>
                        <td class="tbl_middle" style="font-weight: bold">
                            Was a 3rd party involved - either a 3rd party's vehicle, property damage or 
                            bodily injury?</td>
                        <td class="tbl_right">
                             </td>
                    </tr>
                    <tr>
                        <td class="tbl_left">
                             </td>
                        <td class="tbl_middle">
                             </td>
                        <td class="tbl_right" style="font-weight: bold">
                             </td>
                    </tr>
                </table>
            </asp:Panel>
            <table style="width: 100%; text-align: center; vertical-align: top;">
                <tr>
                    <td class="tbl_left">
                        <span style="color: #FF0000">* </span>Is Third Party Involved?</td>
                    <td class="tbl_right">
                        <asp:RadioButtonList ID="opgThirdParty" runat="server" AutoPostBack="True" 
                            RepeatDirection="Horizontal" RepeatLayout="Flow" TabIndex="1" 
                            ForeColor="Maroon">
                            <asp:ListItem Value="1">Yes</asp:ListItem>
                            <asp:ListItem Value="0">No</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                         </td>
                    <td class="tbl_right" style="font-weight: bold">
                        Please describe what happened.</td>
                </tr>
                <tr>
                    <td class="tbl_left">
                        <span style="color: #FF0000">* </span>Initial Incident Description:</td>
                    <td class="tbl_right">
                        <table ID="table2" cellpadding="3" cellspacing="0" 
                            style="width: 100%; border: solid 1px black">
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtInv" runat="server" BorderStyle="Solid" BorderWidth="1px" 
                                        Font-Names="Arial" Font-Size="10pt" Rows="5" TabIndex="1" TextMode="MultiLine" 
                                        Width="100%" ForeColor="Maroon"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <telerik:RadSpell ID="RadSpell1" runat="server" ControlsToCheck="txtInv" 
                                        Height="28px" SupportedLanguages="en-US,English" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                         </td>
                    <td class="tbl_right" style="font-weight: bold">
                        Once the report is complete, click "Submit".<br />
                        <i>If report meets critical criteria, do not submit - follow callout rules.</i></td>
                </tr>
                <tr>
                    <td class="tbl_left" style="height: 25px">
                           
                    </td>
                    <td class="tbl_right" style="height: 25px">
                        </td>
                </tr>
                <tr>
                    <td class="tbl_left">
                         </td>
                    <td class="tbl_right">
                        <b><asp:Literal runat="server" ID="qe_bottom_notes_1"></asp:Literal></b>  <i>
                            <asp:Literal runat="server" ID="qe_bottom_notes_2"></asp:Literal></i></td>
                </tr>
                <tr>
                    <td class="tbl_left">
                         </td>
                    <td class="tbl_right">
                        <asp:Button ID="cmdSubmitBottom" runat="server" Text="Submit" />
                    </td>
                </tr>
            </table>
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
    </telerik:RadAjaxPanel>
</asp:Content>

And here is the codebehind for the page in question:
Imports DRP_Data
Imports System.Web.Configuration
Imports Functions
Imports Telerik.Web.UI
  
Partial Class quick_report
    Inherits System.Web.UI.Page
    Friend mySD As DRP_DataAdapter
    Friend Error_Email As String = ""
    Friend ReportID As String = ""
    Friend AH As New DRP_DataReader
  
    Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
        mySD.DataSet.Clear()
        mySD.CloseConn()
        mySD = Nothing
    End Sub
  
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim myBody As HtmlGenericControl = Master.FindControl("pageBody")
        myBody.Attributes.Add("onkeydown", "javascript:if(window.event.keyCode == 13) window.event.keyCode = 9;")
  
        If Request.Params("userid") IsNot Nothing Then
            Session("userid") = Request.Params("userid")
        End If
  
        Dim lblReportStatus As Label = CType(Master.FindControl("lblReportStatus"), Label)
        lblReportStatus.Visible = False
  
        Dim lblSave As Label = CType(Master.FindControl("lblSave"), Label)
        lblSave.Visible = False
  
        Dim imgSave As ImageButton = CType(Master.FindControl("imgSave"), ImageButton)
        imgSave.Visible = False
  
        Dim imgHome As ImageButton = CType(Master.FindControl("imgHome"), ImageButton)
        imgHome.Visible = False
  
        Dim lblHome As Label = CType(Master.FindControl("lblHome"), Label)
        lblHome.Visible = False
  
        If Session("db_server") = Nothing Then
            Session("db_server") = WebConfigurationManager.AppSettings("db_server").ToString.Trim
            Session("db_name") = WebConfigurationManager.AppSettings("db_name").ToString.Trim
            Session("db_user") = WebConfigurationManager.AppSettings("db_user").ToString.Trim
            Session("db_password") = WebConfigurationManager.AppSettings("db_password").ToString.Trim
        End If
  
        qe_item1.Text = WebConfigurationManager.AppSettings("qe_item1_text").ToString.Trim
        qe_item2.Text = WebConfigurationManager.AppSettings("qe_item2_text").ToString.Trim
        qe_bottom_notes_1.Text = WebConfigurationManager.AppSettings("qe_bottom_notes_1").ToString.Trim
        qe_bottom_notes_2.Text = WebConfigurationManager.AppSettings("qe_bottom_notes_2").ToString.Trim
  
        Error_Email = WebConfigurationManager.AppSettings("error_email").ToString.Trim
  
        CType(Master.FindControl("lblReportStatus"), Label).Text = "Report Status: Open"
        CType(Master.FindControl("lblUserName"), Label).Text = Session("username")
  
        mySD = New DRP_DataAdapter
        mySD.Database_Server = Session("db_server")
        mySD.Database_Name = Session("db_name")
        mySD.Database_UserID = Session("db_user")
        mySD.Database_Passwrod = Session("db_password")
  
        Session("mode") = "ADD"
  
        Try
            mySD.OpenConn()
  
            If Page.IsPostBack = False Then
                opgVehicleTowed.SelectedValue = Nothing
                opgMedicalAway.SelectedValue = Nothing
                'opgFatality.SelectedValue = Nothing
                opgOther.SelectedValue = Nothing
                opgThirdParty.SelectedValue = Nothing
                opgInjury.SelectedValue = Nothing
  
                cboCallersGSN.Focus()
  
                Load_Severity()
            End If
        Catch ex As Exception
  
        End Try
    End Sub
  
    Private Sub Load_Severity()
        If mySD.DataSet.Tables.Contains("c_severity") Then
            mySD.DataSet.Tables("c_severity").Clear()
        End If
  
        mySD.Select_Command = "select 'select one...' as severity, 0 as severityid, 0 as sortby union all select severity, severityid, sortby from accidentseverity order by 3, 1"
        mySD.Fill("c_severity")
  
        cboSeverity.DataSource = mySD.DataSet
        cboSeverity.DataMember = "c_severity"
        cboSeverity.DataTextField = "severity"
        cboSeverity.DataValueField = "severityid"
        cboSeverity.DataBind()
  
        cboSeverity.Items.Remove(cboSeverity.Items.FindByText("Major Medical"))
    End Sub
  
    Private Sub Go_Home()
        Response.Redirect("~/main.aspx", False)
    End Sub
  
    Private Sub Save_Record()
        AH.Server_Address = Session("db_server")
        AH.Server_Database = Session("db_name")
        AH.Server_UserId = Session("db_user")
        AH.Server_Password = Session("db_password")
  
        Try
            AH.OpenConn()
            'Save air_header record so we have a valid air_header_id value
            Dim newReportID As String = ""
            Dim insert_str As String = ""
            insert_str += "0,"
            insert_str += cboLocation.SelectedValue.ToString.Trim + ","
            insert_str += "1,"
            insert_str += cboSeverity.SelectedValue.ToString.Trim + ","
            If txtDateOfAccident.SelectedDate IsNot Nothing Then
                insert_str += "'" + Date.Parse(txtDateOfAccident.SelectedDate.Value.ToShortDateString + " " + Format(txtTimeOfAccident.SelectedDate, "hh:mm tt").ToString).ToString + "'" + ","
            Else
                insert_str += "''" + ","
            End If
            If txtDateReported.SelectedDate IsNot Nothing Then
                insert_str += "'" + Date.Parse(txtDateReported.SelectedDate.Value.ToShortDateString + " " + Format(txtTimeReported.SelectedDate, "hh:mm tt").ToString).ToString + "'" + ","
            Else
                insert_str += "''" + ","
            End If
            If opgDPSGEmployee.SelectedValue = "1" Then
                insert_str += Session("emp_no").ToString + ","
                insert_str += "'" + cboPersonInvolved.Text.Replace("'", "''") + "'" + ","
            Else
                insert_str += "0,"
                insert_str += "'" + txtPersonInvolved.Text.Trim.Replace("'", "''") + "'" + ","
            End If
            insert_str += "'" + txtEmpPhone.Text.Trim + "'" + ","
            insert_str += "'" + txtEmpExt.Text.Trim + "'" + ","
            insert_str += "-1,"
            insert_str += "-1,"
            insert_str += "''" + ","
            insert_str += "'" + txtPlaceOfAccident.Text.Trim.Replace("'", "''") + "'" + ","
            insert_str += Session("callers_gsn").ToString + ","
            insert_str += "'" + txtCallerName.Text.Trim.Replace("'", "''") + "'" + ","
            insert_str += "''" + ","
            'insert_str += IIf(cboSeverity.SelectedItem.Text.Contains("Medical"), "5,", "-1,")
            insert_str += IIf(cboSeverity.SelectedItem.Text.Contains("Medical"), "5,", "6,")
            insert_str += "0,"
            insert_str += "0,"
            insert_str += "0,"
            insert_str += "''" + ","
            insert_str += "0,"
            insert_str += "0,"
            insert_str += "-1,"
            insert_str += "''" + ","
            insert_str += "''" + ","
            insert_str += "''" + ","
            insert_str += "''" + ","
            insert_str += "''" + ","
            insert_str += Session("YAC").ToString + "," 'Yrs At Co
            insert_str += Session("MAC").ToString + "," 'Mos At Co
  
            Dim cur_pos_id As Integer = -1
            cur_pos_id = get_cur_pos_id(Session("YACJ"), Session("MACJ"))
  
            insert_str += cur_pos_id.ToString + "," 'cur_pos_id
            insert_str += "''" + ","
            insert_str += "''" + ","
            insert_str += "''" + ","
            insert_str += "''" + ","
            insert_str += "0" + ","
            insert_str += "0" + ","
            insert_str += "0" + ","
            insert_str += "0" + ","
            insert_str += "0" + ","
            insert_str += "'A'" + ","   'happenedat
            insert_str += "0,"
            insert_str += "''" + ","
            insert_str += "''" + ","
            insert_str += hidCallerTitleId.Value.ToString + ","
            insert_str += "'" + txtCallerPhone.Text.Trim + "'" + ","
            insert_str += "'" + txtCallerExt.Text.Trim + "'" + ","
            insert_str += "'" + txtCallerEMail.Text.Trim.ToLower + "'" + ","
            If opgInjury.SelectedValue = "" Then
                insert_str += "0,"
            Else
                insert_str += opgInjury.SelectedValue.Trim + ","
            End If
            If opgVehicle.SelectedValue = "" Then
                insert_str += "0,"
            Else
                insert_str += opgVehicle.SelectedValue.Trim + ","
            End If
  
            'If opgVehicleTowed.SelectedValue = "" Then
            '    insert_str += "0,"
            'Else
            '    insert_str += opgVehicleTowed.SelectedValue.Trim + ","
            'End If
            insert_str += "0,"
  
            'If opgMedicalAway.SelectedValue = "" Then
            '    insert_str += "0,"
            'Else
            '    insert_str += opgMedicalAway.SelectedValue.Trim + ","
            'End If
            insert_str += "0,"
  
            'If opgFatality.SelectedValue = "" Then
            '    insert_str += "0,"
            'Else
            '    insert_str += opgFatality.SelectedValue.Trim + ","
            'End If
            insert_str += "0,"
  
            'If opgOther.SelectedValue = "" Then
            '    insert_str += "0,"
            'Else
            '    insert_str += opgOther.SelectedValue.Trim + ","
            'End If
            insert_str += "0,"
  
            If opgThirdParty.SelectedValue = "" Then
                insert_str += "0,"
            Else
                insert_str += opgThirdParty.SelectedValue.Trim + ","
            End If
            insert_str += Session("YACJ").ToString + ","
            insert_str += Session("MACJ").ToString + ","
            insert_str += Session("YAC").ToString + ","
            insert_str += Session("MAC").ToString + ","
            insert_str += Session("userid").ToString + ","
            insert_str += cboCallersGSN.SelectedValue.ToString
  
            If Session("mode").ToString.ToUpper = "ADD" Then
                AH.Select_Command = "exec a_air_header " + insert_str
                AH.ExecuteReader()
                If AH.DataReader.HasRows Then
                    AH.DataReader.Read()
                    Session("air_header_id") = AH.DataReader("air_header_id")
                    CType(Master.FindControl("lblReportNo"), Label).Text = "Incident Report No. " + AH.DataReader("reportid").ToString
                    ReportID = AH.DataReader("reportid").ToString
                End If
  
                If txtCallerEMail.Text.Trim.Length > 0 Then
                    Send_EMail()
                End If
                AH.CloseReader()
  
                'Save inv_text
                insert_str = ""
                insert_str += Session("air_header_id").ToString.Trim + ","
                insert_str += "'" + txtInv.Text.Trim.Replace("'", "''") + "'" + ","
                insert_str += "0" + ","
                insert_str += "''" + ","
                insert_str += "''"
  
                If Session("mode").ToString.ToUpper = "ADD" Then
                    AH.Insert_Command = "exec a_air_investigation " + insert_str
                    AH.ExecuteNonQuery("INSERT")
                End If
  
                Dim msg As String = "<div style=""font-family: Arial; font-size: 12pt; text-alignment:center;"">The Report ID is\n</div><div style=""font-family: Arial; font-size: 18pt;"">" + ReportID + "</div>"
                'ScriptManager.RegisterStartupScript(Me, Me.GetType(), "report_no", "radalert('" + msg + "');window.location = 'quick_report.aspx';", True)
                ScriptManager.RegisterStartupScript(Me, Me.GetType(), "report_no", "radpopup('" + msg + "')", True)
            End If
            'Response.Redirect("~/quick_report.aspx", True)
        Catch ex As Exception
            Dim errmsg As String = ""
            errmsg = ex.Message + vbCrLf + ex.Source + vbCrLf + ex.StackTrace
            EMail_Class.Class1.Send_eMail(Error_Email, WebConfigurationManager.AppSettings("email_username").ToString.Trim, "", "Application Error", errmsg)
        Finally
            AH.CloseConn()
            Session("callers_gsn") = ""
            Session("emp_no") = ""
            Session("YACJ") = 0
            Session("MACJ") = 0
            Session("YAC") = 0
            Session("MAC") = 0
            Session("userid") = 0
        End Try
    End Sub
  
    Private Function get_cur_pos_id(ByVal Yrs As Integer, ByVal mos As Integer) As Integer
        Dim RetVal As Integer = -1
        Select Case Yrs
            Case Is < 1
                RetVal = 1
            Case 1 To 5
                RetVal = 2
            Case Is > 5
                RetVal = 3
        End Select
  
        Return RetVal
    End Function
  
    Private Sub Send_EMail()
        Dim Email_Msg As String = ""
        If System.IO.File.Exists(Server.MapPath("body_text.txt")) Then
            Email_Msg = System.IO.File.ReadAllText(Server.MapPath("body_text.txt"))
            Email_Msg = Email_Msg.Replace("<<ReportID>>", ReportID)
            Email_Msg = Email_Msg.Replace("<<CallerName>>", txtCallerName.Text.Trim)
            Email_Msg = Email_Msg.Replace("<<CallerTitle>>", hidCallerTitleId.Value.ToString.Trim)
            Email_Msg = Email_Msg.Replace("<<CallerPhone>>", txtCallerPhone.Text.Trim)
            Email_Msg = Email_Msg.Replace("<<CallerExt>>", txtCallerExt.Text.Trim)
            Email_Msg = Email_Msg.Replace("<<CallerEmail>>", txtCallerEMail.Text.Trim)
            Email_Msg = Email_Msg.Replace("<<EmpName>>", txtPersonInvolved.Text.Trim)
            Email_Msg = Email_Msg.Replace("<<EmpPhone>>", txtEmpPhone.Text.Trim)
            Email_Msg = Email_Msg.Replace("<<EmpExt>>", txtEmpExt.Text.Trim)
            Email_Msg = Email_Msg.Replace("<<Location>>", cboLocation.Text.Trim)
            Email_Msg = Email_Msg.Replace("<<DateOfIncident>>", Format(txtDateOfAccident.SelectedDate, "MM/dd/yyyy").ToString)
            Email_Msg = Email_Msg.Replace("<<TimeOfIncident>>", Format(txtTimeOfAccident.SelectedDate, "hh:mm tt").ToString)
            Email_Msg = Email_Msg.Replace("<<PlaceOfIncident>>", txtPlaceOfAccident.Text.ToString)
            Email_Msg = Email_Msg.Replace("<<DateReported>>", Format(txtDateReported.SelectedDate, "MM/dd/yyyy").ToString)
            Email_Msg = Email_Msg.Replace("<<TimeReported>>", Format(txtTimeReported.SelectedDate, "hh:mm tt").ToString)
            Email_Msg = Email_Msg.Replace("<<InjuryInvolved>>", IIf(opgInjury.SelectedValue = "1", "Injury: Yes", "Injury: No"))
            Email_Msg = Email_Msg.Replace("<<Severity>>", cboSeverity.SelectedItem.Text.Trim)
            Email_Msg = Email_Msg.Replace("<<VehicleInvolved>>", IIf(opgVehicle.SelectedValue = "1", "Vehicle Involved: Yes", "Vehicle Involved: No"))
            Email_Msg = Email_Msg.Replace("<<VehicleTowed>>", IIf(opgVehicleTowed.SelectedValue = "1", "Vehicle Towed: Yes", "Vehicle Towed: No"))
            Email_Msg = Email_Msg.Replace("<<MedicalAway>>", IIf(opgMedicalAway.SelectedValue = "1", "Medical Away: Yes", "Medical Away: No"))
            Email_Msg = Email_Msg.Replace("<<Other>>", IIf(opgOther.SelectedValue = "1", "Other: Yes", "Other: No"))
            Email_Msg = Email_Msg.Replace("<<ThirdPartyInvolved>>", IIf(opgThirdParty.SelectedValue = "1", "Third Party Involved: Yes", "Third Party Involved: No"))
            Email_Msg = Email_Msg.Replace("<<IncidentDescription>>", txtInv.Text.Trim)
        Else
            Email_Msg = "Please log into SAFE in the next 24 hours and update the report.  If there are any questions, please contact your EH&S contact." + vbCrLf
        End If
  
        EMail_Class.Class1.Send_eMail(txtCallerEMail.Text.Trim.ToLower(), WebConfigurationManager.AppSettings("email_username").ToString.Trim, "", "Your SAFE ID # is " + ReportID.ToString, Email_Msg)
    End Sub
  
    Protected Sub opgInjury_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles opgInjury.SelectedIndexChanged
        If opgInjury.SelectedValue.Length > 0 Then
            If opgInjury.SelectedValue = "0" Then
                For X As Integer = 0 To (cboSeverity.Items.Count - 1)
                    cboSeverity.Items(X).Enabled = False
                Next
                cboSeverity.Items.FindByText("Near Miss").Enabled = True
                cboSeverity.SelectedValue = cboSeverity.Items.FindByText("Near Miss").Value
            Else
                For X As Integer = 0 To (cboSeverity.Items.Count - 1)
                    cboSeverity.Items(X).Enabled = True
                Next
                'cboSeverity.Items.FindByText("Major Medical").Enabled = False
                cboSeverity.Items.FindByText("Near Miss").Enabled = False
                cboSeverity.SelectedValue = 0
            End If
        End If
        opgInjury.Focus()
    End Sub
  
    Protected Sub opgVehicle_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles opgVehicle.SelectedIndexChanged
        If opgVehicle.SelectedValue.Length > 0 Then
            'pnlT3.Visible = (opgVehicle.SelectedValue = "1")
            'opgThirdParty.Enabled = (opgVehicle.SelectedValue = "1")
            'opgThirdParty.SelectedValue = Nothing
            'If pnlT3.Visible Then
            '    opgVehicleTowed.Focus()
            'End If
        End If
    End Sub
  
    Protected Sub opgVehicleTowed_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles opgVehicleTowed.SelectedIndexChanged, opgMedicalAway.SelectedIndexChanged, opgOther.SelectedIndexChanged
        If opgVehicleTowed.SelectedValue = "0" And opgMedicalAway.SelectedValue = "0" Then
            opgOther.SelectedValue = "1"
        Else
            opgOther.SelectedValue = "0"
        End If
    End Sub
  
    Protected Sub cmdSubmitTop_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdSubmitTop.Click, cmdSubmitBottom.Click
        If Page_IsValid() Then
            Save_Record()
        End If
    End Sub
  
    Private Function Page_IsValid() As Boolean
        Dim RetVal As Boolean = True
        Dim Cont As Boolean = True
  
        If txtCallerName.Text.Length = 0 Then
            Cont = False
            ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('A Caller is required.');", True)
            cboCallersGSN.Focus()
            Exit Function
        End If
  
        If txtCallerPhone.Text.Trim.Length = 0 Then
            Cont = False
            ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('Caller\'s Phone # is required.');", True)
            txtCallerPhone.Focus()
            Exit Function
        Else
            If txtCallerPhone.Text.Trim.Length < 10 Then
                Cont = False
                ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('Caller\'s Phone # must be complete.');", True)
                txtCallerPhone.Focus()
                Exit Function
            End If
        End If
  
        If txtCallerEMail.Text.Length > 0 Then
            If Not EmailAddressCheck(txtCallerEMail.Text) Then
                Cont = False
                ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('Caller\'s E-Mail Address is invalid.');", True)
                txtCallerEMail.Focus()
                Exit Function
            End If
        Else
            Cont = False
            ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('Caller\'s E-Mail is required.');", True)
            txtCallerEMail.Focus()
            Exit Function
        End If
  
        If opgDPSGEmployee.SelectedValue = "1" Then
            If cboPersonInvolved.SelectedValue = "0" Then
                Cont = False
                ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('Person Involved is required.');", True)
                cboPersonInvolved.Focus()
                Exit Function
            End If
  
            If cboLocation.SelectedValue = "0" Then
                Cont = False
                ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('Location is required.');", True)
                cboLocation.Focus()
                Exit Function
            End If
        Else
            If txtPersonInvolved.Text.Trim.Length = 0 Then
                Cont = False
                ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('Person Involved is required.');", True)
                txtPersonInvolved.Focus()
                Exit Function
            End If
        End If
  
        If txtDateOfAccident.SelectedDate Is Nothing Then
            Cont = False
            ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('Date & Time of Incident are required.');", True)
            txtDateOfAccident.Focus()
            Exit Function
        Else
            If txtDateOfAccident.SelectedDate > Today() Then
                Cont = False
                ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('Date & Time of Incident cannot be a future date or time.');", True)
                txtDateOfAccident.Focus()
                Exit Function
            End If
        End If
        'If txtTimeOfAccident.Text.Trim.Length = 2 Then
        If Format(txtTimeOfAccident.SelectedDate, "hh:mm tt").ToString.Trim.Length = 0 Then
            Cont = False
            ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('Date & Time of Incident are required.');", True)
            txtTimeOfAccident.Focus()
            Exit Function
        Else
            If New Date(Year(txtDateOfAccident.SelectedDate), Month(txtDateOfAccident.SelectedDate), Day(txtDateOfAccident.SelectedDate), Hour(txtTimeOfAccident.SelectedDate), Minute(txtTimeOfAccident.SelectedDate), 0) > Now() Then
                Cont = False
                ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('Date & Time of Incident cannot be a future date or time.');", True)
                txtTimeOfAccident.Focus()
                Exit Function
            End If
        End If
  
        If txtPlaceOfAccident.Text.Trim.Length = 0 Then
            Cont = False
            ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('Place of Incident is required.');", True)
            txtPlaceOfAccident.Focus()
            Exit Function
        End If
  
        If txtDateReported.SelectedDate Is Nothing Then
            Cont = False
            ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('Date & Time of when Incident was Reported are required.');", True)
            txtDateReported.Focus()
            Exit Function
        Else
            If txtDateReported.SelectedDate > Today() Then
                Cont = False
                ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('Date & Time of when Incident was Reported cannot be a future date or time.');", True)
                txtDateReported.Focus()
                Exit Function
            End If
        End If
        'If txtTimeReported0.Text.Trim.Length = 2 Then
        If Format(txtTimeReported.SelectedDate, "hh:mm tt").ToString.Trim.Length = 0 Then
            Cont = False
            ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('Date & Time of when Incident was Reported are required.');", True)
            'txtTimeReported0.Focus()
            txtTimeReported.Focus()
            Exit Function
        Else
            If New Date(Year(txtDateReported.SelectedDate), Month(txtDateReported.SelectedDate), Day(txtDateReported.SelectedDate), Hour(txtTimeReported.SelectedDate), Minute(txtTimeReported.SelectedDate), 0) > Now() Then
                Cont = False
                ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('Date & Time of when Incident was Reported cannot be a future date or time.');", True)
                txtTimeReported.Focus()
                Exit Function
            End If
        End If
  
        'Compare Date/Time of Accident vs. Date/Time Reported
        Dim ADT As DateTime = Date.Parse(Format(txtDateOfAccident.SelectedDate, "MM/dd/yyyy").ToString + " " + Format(txtTimeOfAccident.SelectedDate, "hh:mm tt").ToString)
        Dim RDT As DateTime = Date.Parse(Format(txtDateReported.SelectedDate, "MM/dd/yyyy").ToString + " " + Format(txtTimeReported.SelectedDate, "hh:mm tt").ToString)
        If ADT.Date() > Today() Then
            Cont = False
            ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "vals", "alert('Date of Incident cannot be after today.');", True)
            txtDateOfAccident.Focus()
            Exit Function
        Else
            If RDT.Date() > Today() Then
                Cont = False
                ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "vals", "alert('Date Reported cannot be after today.');", True)
                txtDateReported.Focus()
                Exit Function
            End If
            If RDT < ADT Then
                Cont = False
                ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "vals", "alert('Date & Time of Incident must be before Date & Time Reported.');", True)
                txtDateOfAccident.Focus()
                Exit Function
            End If
        End If
  
        If opgInjury.SelectedValue = Nothing Then
            Cont = False
            ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('""Is Injury Involved"" is required.');", True)
            opgInjury.Focus()
            Exit Function
        End If
  
        If cboSeverity.SelectedItem.Text.Contains("select one") Then
            Cont = False
            ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('Severity is required.');", True)
            cboSeverity.Focus()
            Exit Function
        End If
  
        If opgVehicle.SelectedValue = Nothing Then
            Cont = False
            ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('""Was Vehicle Involved"" is required.');", True)
            opgVehicle.Focus()
            Exit Function
        End If
  
        If opgVehicle.SelectedValue = "1" Then
            'If opgVehicleTowed.SelectedValue = Nothing Then
            '    Cont = False
            '    ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('""Vehicle Towed"" is required.');", True)
            '    opgVehicleTowed.Focus()
            '    Exit Function
            'End If
            'If opgMedicalAway.SelectedValue = Nothing Then
            '    Cont = False
            '    ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('""Medical Away From Scene"" is required.');", True)
            '    opgMedicalAway.Focus()
            '    Exit Function
            'End If
            ''If opgFatality.SelectedValue = Nothing Then
            ''    Cont = False
            ''    ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('""Fatality"" is required.');", True)
            ''    opgFatality.Focus()
            ''    Exit Function
            ''End If
            If opgThirdParty.SelectedValue = Nothing Then
                Cont = False
                ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('""Is Third Party Involved"" is required.');", True)
                opgThirdParty.Focus()
                Exit Function
            End If
        End If
  
        If txtInv.Text.Trim.Length = 0 Then
            Cont = False
            ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "reqfields", "alert('Initial Incident Description is required.');", True)
            txtInv.Focus()
            Exit Function
        End If
  
        Return RetVal
    End Function
  
    Protected Sub cboCallersGSN_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles cboCallersGSN.SelectedIndexChanged
        Session("callerid") = cboCallersGSN.SelectedValue
        Populate_Fields()
        cboCallersGSN.Focus()
    End Sub
  
    Private Sub Populate_Fields()
        Dim myED As New DRP_Data.DRP_DataReader
  
        myED.Server_Address = mySD.Database_Server
        myED.Server_Database = mySD.Database_Name
        myED.Server_UserId = mySD.Database_UserID
        myED.Server_Password = mySD.Database_Passwrod
  
        Try
            myED.OpenConn()
            myED.Select_Command = "exec s_callers_info '" + Session("callerid").ToString.Trim + "'"
            myED.ExecuteReader()
            If myED.DataReader.HasRows Then
                myED.DataReader.Read()
                Session("callers_gsn") = myED.DataReader("gsn").ToString.Trim
                txtCallerEMail.Text = myED.DataReader("email").ToString.Trim
                txtCallerTitle.Text = myED.DataReader("title").ToString
                txtCallerName.Text = myED.DataReader("name").ToString
                hidCallerTitleId.Value = myED.DataReader("titleid").ToString
            Else
                Session("callers_gsn") = 0
                txtCallerTitle.Text = ""
                txtCallerName.Text = ""
                txtCallerEMail.Text = ""
                hidCallerTitleId.Value = 0
            End If
            myED.CloseReader()
  
            'Load_Employees()
        Catch ex As Exception
  
        Finally
            myED.CloseConn()
        End Try
    End Sub
  
    Protected Sub opgDPSGEmployee_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles opgDPSGEmployee.SelectedIndexChanged
        If opgDPSGEmployee.SelectedValue IsNot Nothing Then
            If opgDPSGEmployee.SelectedValue = "1" Then
                cboPersonInvolved.Visible = True
                cboPersonInvolved.SelectedValue = 0
                cboPersonInvolved.Text = ""
                hidEmpLocation.Value = ""
                cboLocation.Visible = True
                lblNA.Visible = False
  
                txtPersonInvolved.Visible = False
                txtPersonInvolved.Text = ""
  
                cboPersonInvolved.Focus()
            Else
                Session("YACJ") = 0
                Session("MACJ") = 0
                Session("YAC") = 0
                Session("MAC") = 0
  
                cboPersonInvolved.Visible = False
                cboPersonInvolved.SelectedValue = 0
                cboPersonInvolved.Text = ""
                hidEmpLocation.Value = ""
                cboLocation.Visible = False
                lblNA.Visible = True
  
                txtPersonInvolved.Visible = True
                txtPersonInvolved.Text = ""
  
                txtPersonInvolved.Focus()
            End If
        End If
    End Sub
  
    Protected Sub cboPersonInvolved_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles cboPersonInvolved.SelectedIndexChanged
        If cboPersonInvolved.SelectedValue <> "0" Then
            Dim myED As New DRP_Data.DRP_DataReader
  
            myED.Server_Address = mySD.Database_Server
            myED.Server_Database = mySD.Database_Name
            myED.Server_UserId = mySD.Database_UserID
            myED.Server_Password = mySD.Database_Passwrod
  
            Try
                myED.OpenConn()
                myED.Select_Command = "exec s_emps_info '" + cboPersonInvolved.SelectedValue.ToString.Trim + "'"
                myED.ExecuteReader()
                If myED.DataReader.HasRows Then
                    myED.DataReader.Read()
                    Session("emp_no") = myED.DataReader("emp_no")
                    Session("YACJ") = myED.DataReader("yrs_at_current_job")
                    Session("MACJ") = myED.DataReader("mos_at_current_job")
                    Session("YAC") = myED.DataReader("yrs_at_company")
                    Session("MAC") = myED.DataReader("mos_at_company")
                    hidEmpLocation.Value = myED.DataReader("location").ToString
                    cboLocation.SelectedValue = 0
                    cboLocation.Text = ""
                Else
                    Session("emp_no") = 0
                    Session("YACJ") = 0
                    Session("MACJ") = 0
                    Session("YAC") = 0
                    Session("MAC") = 0
                    cboPersonInvolved.SelectedValue = "0"
                    hidEmpLocation.Value = ""
                    cboLocation.SelectedValue = 0
                    cboLocation.Text = ""
                End If
                myED.CloseReader()
            Catch ex As Exception
  
            Finally
                myED.CloseConn()
            End Try
            cboPersonInvolved.Focus()
        Else
            Session("YACJ") = 0
            Session("MACJ") = 0
            Session("YAC") = 0
            Session("MAC") = 0
        End If
    End Sub
End Class

Thanks,
Ken
Nencho
Telerik team
 answered on 13 Mar 2013
6 answers
249 views
Hi,

When I change rad window properties its changing Confirm popup/rad alert  not RadWindow after clicking edit/add new  button from Rad Grid


Thank You
Bala
Bala
Top achievements
Rank 1
 answered on 13 Mar 2013
6 answers
233 views
Hi,

I lost about 2 hours trying to find my problem.

I am trying to clear the selection (server side) of a RadComboBox using LoadOnDemand after the user clicked on a radio button.

For the moment, I am trying this, but this is not working:

cboChambreA.Text = Nothing
cboChambreA.ClearSelection()

How can I clear or set the selected item to nothing?

Thanks.

- Jocelyn
Nencho
Telerik team
 answered on 13 Mar 2013
1 answer
135 views
Hi,
I am using radcombobox having item templates. The data to the radcombo is binded at client side. The itemtemplate consists of div.
when the dropdown is expanded, the list items looks like <<Account Numbe>>r <<AccountName>>.  When I select any of the value  from the dropdown, text would appear as Account Number Account Name. I wanted to displaye only Account Number, So I modified the data in OnclientselectedIndex changed event. This works fine.

When i use keyboard to move through the items, Account Number Account Name is displayed. Here also I want to set the text for the combox as only Account Number.
 I made use of OnclientKeypressing event and added sender.set_text("ABC"); The code gets executed, but, I do not see the changes refelected.

I also trie making user of get_inpiutDOmelement and set the value. But nothing seems to reflect in browser.

Please let me know how I can modify the value of the combox text while using keyboard.
Hristo Valyavicharski
Telerik team
 answered on 13 Mar 2013
14 answers
1.1K+ views

I am creating dynamic columns in a grid. How do I do this in the code behind:

<telerik:GridTemplateColumn UniqueName="vendor" HeaderText="vendor">

 <ItemTemplate><%# Eval("vendor") %></ItemTemplate>

 <EditItemTemplate>

  <asp:DropDownList ID="vendorDropDown" runat="server">

   <asp:ListItem Text="Al1" Value="Al1"/>

   <asp:ListItem Text="Al2" Value="Al2"/>

   <asp:ListItem Text="Al3" Value="Al3"/>

   <asp:ListItem Text="Al4" Value="Al4"/>

  </asp:DropDownList>

 </EditItemTemplate>

</telerik:GridTemplateColumn>

Andrey
Telerik team
 answered on 13 Mar 2013
1 answer
91 views
Hi, 

We've upgraded from Telerik ASP.Net 2010 to 2012. And since then, we have a button that has a strange display (See attachment)

<div class="submit">
                    <telerik:RadButton ID="btnSubmit2" OnClientLoad="OnSubmitButtonLoad"  runat="server" Height="35px" Text="Submit" CssClass="button" />     
              </div>

Any idea of how to solve this ?

Thanks
Danail Vasilev
Telerik team
 answered on 13 Mar 2013
5 answers
181 views
Hello,

I have a webpage where I use 13 RadDateTime Pickers. This impacts the performance and increases the size of my page; so I tried to implement the "Shared Calendar/TimeView" concept as in here: http://www.telerik.com/help/aspnet-ajax/calendar-shared-calendars.html

My page consists of an upper div that has 4 of these DateTime Pickers and then a RadPanelBar that has 3 RadPanelBar items each of which has an item template that contains some DateTime Pickers along other controls.

As you advised in the link I posted above, I defined the shared Calendar and shared TimeView first thing in the page, they preceed the other DateTime Pickers that use them. However, the problem I encountered is that the shared controls that I defined in the upper level of the page are not defined to the ones inside any of the RadPanelBar items. That is, I had to use 4 shared Calendars and TimeViews: one for the upper div, and one for each of the 3 RadPanelBar items as each one is only seeing what's in its scope.

This doesn't serve my case, the performace is still bad and the page size is big. So is there any solution to this case? How can I use only one shared Calendar and TimeView for the whole page and still get all the DateTime Pickers in the RadPanelBar and page in general see them?

Many Thanks!
Kevin
Top achievements
Rank 2
 answered on 13 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?