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

ItemCommand Not Firing for Some Events

3 Answers 23 Views
Grid
This is a migrated thread and some comments may be shown as answers.
southwynd
Top achievements
Rank 1
southwynd asked on 24 Jun 2014, 10:17 PM
I have a telerik radgrid that uses a WebUserControl for editing data.  The Delete ItemCommand fires properly but the Insert ItemCommand does not.  Also, the Update ItemCommand opens the WebUserControl but once it opens, the Cancel and Update commands do not fire from the control.

<telerik:RadGrid ID="rgvEdit" runat="server" AutoGenerateColumns="False" CellSpacing="0" allowpaging="True" PageSize="75"
    GridLines="None" style="margin-top: 0px" RegisterWithScriptManager="False" DataSourceID="dsGetChargeForms">
     
    <MasterTableView NoMasterRecordsText="No locations found." CommandItemDisplay="Top" PageSize="75" AllowPaging="true" AllowSorting="false" DataKeyNames="id" InsertItemPageIndexAction="ShowItemOnCurrentPage">
        <CommandItemSettings ShowAddNewRecordButton="true" AddNewRecordText="Add New" ShowRefreshButton="false"/>
        <Columns>   
            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"/>                                 
            <telerik:GridBoundColumn HeaderText="Subcategory" DataField="subcategory" UniqueName="subcategory" />
            <telerik:GridBoundColumn DataField="bar_procedure_code" HeaderText="Proc Code"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="display_code" HeaderText="Display Code" SortExpression="display_code" UniqueName="display_code"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="description" HeaderText="Description" SortExpression="description" UniqueName="description"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="min" HeaderText="Min" SortExpression="min" UniqueName="min"></telerik:GridBoundColumn>
            <telerik:GridCheckBoxColumn DataField="requires_modifier" DataType="System.Boolean" HeaderText="Modifer?" SortExpression="requires_modifier" UniqueName="requires_modifier"></telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn DataField="requires_epsdt" DataType="System.Boolean" HeaderText="EPSDT?" SortExpression="requires_epsdt" UniqueName="requires_epsdt"></telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn DataField="requires_contraceptive_mgmnt" DataType="System.Boolean" HeaderText="Cont. Mgmt?" SortExpression="requires_contraceptive_mgmnt" UniqueName="requires_contraceptive_mgmnt"></telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn DataField="no_md_charge" DataType="System.Boolean" HeaderText="No MD?" HeaderTooltip="No MD Charge" UniqueName="no_md_charge"></telerik:GridCheckBoxColumn>
            <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton" />
        </Columns>                           
        <EditFormSettings UserControlName="OutptMgmtEditChgFormDetail.ascx" EditFormType="WebUserControl" EditColumn-UniqueName="OutptMgmtEditChgFormDetailCommand1">
        </EditFormSettings>
    </MasterTableView>
 
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
    </HeaderContextMenu>
</telerik:RadGrid>
 
<%--Datasources--%>
<asp:SqlDataSource ID="dsGetChargeForms" runat="server" ConnectionString="<%$ ConnectionStrings:OutpatientChargesConnectionString %>" SelectCommand="pSDGenie_OutpatientCharges_Get_ChargeForms" SelectCommandType="StoredProcedure">
    <SelectParameters>
        <asp:ControlParameter ControlID="ddlEditClinic" DefaultValue="" Name="Clinic" PropertyName="SelectedValue" Type="String" />
        <asp:ControlParameter ControlID="ddlEditCategory" DefaultValue="" Name="Category" PropertyName="SelectedValue" Type="String" />
    </SelectParameters>
</asp:SqlDataSource>

Here is my ItemCommand code.  This was working correctly but today I must have introduced a bug that affected it.
Private Sub rgvEdit_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles rgvEdit.ItemCommand
    Select Case e.CommandName
        Case "PerformInsert"
            Dim MyUserControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)
 
            If MyUserControl IsNot Nothing Then
                'Insert
                Dim chgId As Integer 'ToDo: get charge id
 
                Dim subcategory As String = TryCast(MyUserControl.FindControl("ddlSubcategories"), DropDownList).SelectedValue
                Dim procedureCode As String = TryCast(MyUserControl.FindControl("txtProcedureCode"), TextBox).Text
                Dim displayCode As String = TryCast(MyUserControl.FindControl("txtDisplayCode"), TextBox).Text
                Dim description As String = TryCast(MyUserControl.FindControl("txtDescription"), TextBox).Text
                Dim minutes As String = TryCast(MyUserControl.FindControl("txtMinutes"), TextBox).Text
                Dim blnModifier As Boolean = TryCast(MyUserControl.FindControl("cbxRequiresModifier"), CheckBox).Checked
                Dim blnEpsdt As Boolean = TryCast(MyUserControl.FindControl("cbxRequiresEPSDT"), CheckBox).Checked
                Dim blnContMgmt As Boolean = TryCast(MyUserControl.FindControl("cbxRequiresContraceptiveMgmt"), CheckBox).Checked
                Dim blnNoMd As Boolean = TryCast(MyUserControl.FindControl("cbxNoMdCharge"), CheckBox).Checked
                Dim userMeditechId As String = process.UserInfo_SDGenieMeditechID
 
                If IsNumeric(minutes) = False Then
                    minutes = "0"
                End If
 
                If OCTools.AddChargeFormDefaultValue(Me.ddlEditClinic.SelectedValue, Me.ddlEditCategory.SelectedValue, subcategory, procedureCode, displayCode, description, minutes, blnModifier, blnEpsdt, blnContMgmt, blnNoMd) = True Then
                    Log("Inserted New Charge Info", String.Format("{0} inserted new charge info with ID {1}", process.UserInfo_SDGenieUserName, chgId))
                    Me.UpdateUser("Insert")
                Else
                    Me.UpdateUser("Error")
                End If
            End If
        Case "Update"
            Dim MyUserControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)
 
            If MyUserControl IsNot Nothing Then
                Dim id As String = TryCast(MyUserControl.FindControl("lblID"), Label).Text
                Dim subcategory As String = TryCast(MyUserControl.FindControl("ddlSubcategories"), DropDownList).SelectedValue
                Dim procedureCode As String = TryCast(MyUserControl.FindControl("txtProcedureCode"), TextBox).Text
                Dim displayCode As String = TryCast(MyUserControl.FindControl("txtDisplayCode"), TextBox).Text
                Dim description As String = TryCast(MyUserControl.FindControl("txtDescription"), TextBox).Text
                Dim minutes As String = TryCast(MyUserControl.FindControl("txtMinutes"), TextBox).Text
                Dim blnModifier As Boolean = TryCast(MyUserControl.FindControl("cbxRequiresModifier"), CheckBox).Checked
                Dim blnEpsdt As Boolean = TryCast(MyUserControl.FindControl("cbxRequiresEPSDT"), CheckBox).Checked
                Dim blnContMgmt As Boolean = TryCast(MyUserControl.FindControl("cbxRequiresContraceptiveMgmt"), CheckBox).Checked
                Dim blnNoMd As Boolean = TryCast(MyUserControl.FindControl("cbxNoMdCharge"), CheckBox).Checked
                Dim userMeditechId As String = process.UserInfo_SDGenieMeditechID
 
                If OCTools.UpdChargeFormDefaultValue(CInt(id), subcategory, procedureCode, displayCode, description, minutes, blnModifier, blnEpsdt, blnContMgmt, blnNoMd) = True Then
                    Log("Updated Charge Info", String.Format("{0} updated charge info with ID {1}", process.UserInfo_SDGenieUserName, id))
                    Me.UpdateUser("Update")
                Else
                    Me.UpdateUser("Error")
                End If
            End If
        Case "Delete"
            Dim id As Integer = 0
            Try
                id = DirectCast((DirectCast(e.Item, GridDataItem)).GetDataKeyValue("id"), Integer)
            Catch ex As Exception
            End Try
 
            If id > 0 Then
                If OCTools.DelChargeFormDefaultValue(id) = True Then
                    Log("Deleted Charge Info", String.Format("{0} deleted charge info with ID {1}", process.UserInfo_SDGenieUserName, id))
                    Me.UpdateUser("Delete")
                Else
                    Me.UpdateUser("Error")
                End If
            End If
        Case Else
            'Do Nothing
    End Select
End Sub




3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 25 Jun 2014, 09:02 AM
Hi southwynd,

Unfortunately I couldn't replicate the issue at my end. The provided code is working fine at my end. Please provide your full code for further help.

Thanks,
Shinu.
0
southwynd
Top achievements
Rank 1
answered on 25 Jun 2014, 12:22 PM
Here is the webpage:

<%@ Page Title="SDGenie - Outpatient Charges Management Tools" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="OutptMgmt.aspx.vb" Inherits="SDGenie.OutptMgmt" MaintainScrollPositionOnPostback="true"  %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
 
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .rbl-horizontal label {margin-left:3px; margin-right:10px;}
        .alert-box {
            color:#555;
            border-radius:10px;
            font-family:Tahoma,Geneva,Arial,sans-serif;font-size:11px;
            padding:10px 10px 10px 36px;
            margin:10px;
        }
        .error {
            background:#ffecec url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAACYQAAAmEBwTBV+gAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAASRSURBVDiNdZRdaJZlGMd/1/s8j+/m2Pya+THYyJiiUpMpeZCTrRbWpBmGGhQjV+HBREtcs1BRO5HwUAUPnCJBWEemKZEaw+WGA0tJUDC1onLzk73b+z73c391sHdv0/SGP9cNN/zuP/yv6xLvPY+ftsrK8IPm5q6y0tI5HhDAA4iM3K31zhhyWt86eenSK592dQ0+zpDHwR9Omxa939BwpgzqvHN4kcKb8x6vFFiLiIAIdubMn09duVL/2blzg08FrxGJ1i1d+n35pEkNo0CXd+u0xmnN6DeSd58CgrlzL5+8eHHJlq6uzCgrNRa6trb25MSSkgaTJAxFEUMiaKVIhoZQ2SwmSdBao7UmNobBkhIMYG/ceOGN+vreLxobyx4BrxEJ19bUnJg6cWKjVYrhoiImtLVR1NrKkHOoXA6dJCRakyQJOWuJV65kfFsbmSlT0ElCrq9v3rIFC7o/X7y4FEBWQ/Te/Pnflk+a9JoTQZWWMrm9nYqaGgB+6+7mzp49hLkciGBSKaKWFqoaG0mShEx/P5kDByi5e5dABD9jxi/HLlyoC9ZXVGyonjx5vbUWawzZujrmrVxJEAQEQcCUqiqSigoenD+Ptpbxra1UNzUVcgmLi7mTyRBdu4azFgYHp5dEURQGkLJaYwErwrgTJ+grK+OltjZEBO89sxsa8ECmv595zc1Ya0eCdY6bZ86QOn6cxBhSIgQA1hI6Y7xNEpwIzjmM95jOTnpEqNuwAQDvPfMaGzHGYIwpQK+fPk3m0CHS1qLygYUiGOd86JxzTiksoJ0rOM/s388573l582acczjnCm0GcPnYMQb27iX0HidCIEKYb03tnEs5a51VChvHOK2x+X61StG/bx+/dnfjvScMQ6IoIgxD7g8McHXvXszwMIlSI4rj/+5a+5QeHvYmk8HGMVYpnFKYOEY7x4yODp5buBCdbzMRIYoiKqqqqNm2jeEoIo5j1Ggr5mW09qFTylml0IAWwaZSqHSa6bt382JLC1prvPcEQYBzruB80fLl4D197e2My+WIRHD5MTfgQ8kvGRmZb4wI5Tt3smTdOrLZbAHce+QID/v7eWvHDtLpNFEUUdvUhNGa3o0bKcrlGAdYIBbRQR3MnwkrAPHA4OrVLNu1izAMUUqhtabn8GGub93KYHc3v+dyzFm6lCiKEBGemTWLf+KYe2fPIlqD1txLklNBOVwK4dkJsCAA7PXrZCormbVoEXEc09PZyR/btxNoDcDD3l7+zOWYW19POp3mak8PP23ZQpDN4oG/4Ngt+Ei896wRkefhSDW8WwwMFRcz++BB7t++zc2ODtB6JIO8FFC1aRO1K1ZwdNUqUgMDCHAbvnsAbx713jyyNreJfFkN70wAhoqKcM7hk6QANGNqApjSUlKZDAr4G04NwxtHvbf/28cAn4h8VQ1vTx3jcCxwVDY/DIPATfhBweuj0CeCAT4W+boaVs18AtTm5YB7wDX4MYFXx0KfCgZYL/JNBDV+DIwxTj0Qw40Elj8OLYBFJADSQDFQlK+jGp+vESN7xjGSXxbIjVEMDOdr8i+bBZxZ9af2zgAAAABJRU5ErkJggg==') no-repeat 10px 50%;
            border:1px solid #f5aca6;
        }
        .success {
            background:#e9ffd9 url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABh0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzT7MfTgAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8wNy8xMSix4IAAAAQvSURBVEiJtZZbaBxVGMd/c8t2k3Y31w1tTWxpQxXFpiIUChbfCsaXPlTxpVKKRHwQWtNiLSqlaLGmYt9M6+W9CKJY9cWiCEKxJKWUUqLQJrqN7e4mO7szc87szJnxYbKTbJIXwR74mDNnDv/fdznzzWhxHPMwh/5Q1QFzrUVtVEvnx196/WKlao8s2PU+ty5Nr+ERWjLUM6qUWa9dvvLr5KvNvfHE6mxoK1PUFD93+PQHxbnyMcs0TSPXgE4HlfUQysG2PUqzgn/uuNTcWriuKxy/eat4Yi1IC6ApfurlE1MdUddwpr+Bytk4URU3qiOVi4y8xJRABpK/pgQzkw5Gt5iaO+U+rY1qLRB9pfg7B45Nd5uF4cIOA6NL4sfekmhqAiE9xgY+oX2zYPOeBnJe7cq9qU+vTHFLkc8dPn0mb/QOdQyESN1JxGKBH4kWgAg89veMsqdnH9pCG1Hs07szwCnGQ10bOLNcswVQvFcea+sNEOYCdVVFqCVIKq4EQ+ZODm45CsBAtAO5EGKaEf1PgFNibE3A2IuvXTR0w1SdVeqqihNWcaLairx76IHBka3jqcC27JMEdkTkQ/4RoIGZN7nQfJ4e0/lqbaS/YFCPJCjwQx+7MY+PQOIi8XB9h5ODF9jYPpgCIn/RGqDr0J6HQDCyKoLKgt1Hdx1X1TCjDEceHadfbaFSqWDXbRyvzvOdB9lbeCEVv3n3Op/9dH6RBHEDOnqg4VJYBXAd31RZDxG5TNdu0JvZyLs7Jzi69WOC+xoFbyuHBt9KxW1ngTcmXkHPgt4GMRAHYGVAuUuZSSeiIfACC19LzviN8lWe6t3Ns4P7uNT3O8X6XXJtnSngo69Ocbt8A6sf9AxoUQJQElBrFFlZMqxWk4L6sWDOnU035bKdPF4YTu+/v/o1n185j5EHoz1RiVVSB1kGwyJcBTDbo9KDGYEfCgLN59KdT7lnL0FaU3MIYz0YWdD0xPNIJCYegKnzYBXA6uC70qyH9CWNUDItr3Pg29188dv5FsDBD/fjaTZ6B2jmorgHyoWgBn4VTIPLzf1pL9JGNbZtGgz6HovNzEaBFBJR9RH3Q4azexnf/yU/XvuG9y4dwcyDsSHxPgogkhD7UJsFzyVU27Ga/ailXW/o1c7OXJNvDzwXEBoBUZvCyMdMzf/CyMQuqhUbqxv0dctS44LywJ8HZw6yvZz1lmm2RACweVP+D7ccbC8842OtV0QNiBxQDigBcQjEyTXyIKyDvA+1v8Eq8KccZAiW2nZag+ZC8Z49ZObCybs/R5RvJd5Bkm/dWvR88cSEDtRnoDoDVg+T4oe4RbwlgnRhMZKuHO87JY7HAjObS97QTAfEEkQZ3CLICmgWYZvJWTHEyZXiawKWQwDyJhcDj5GGQ1/oYqLAtAhNnZJhcNkt8N8+mf/3eOh/Ff8CSoplWGYhzlUAAAAASUVORK5CYII=') no-repeat 10px 50%;
            border:1px solid #a6ca8a;
        }
    </style>
</asp:Content>
 
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 
   <!-- RAD SCRIPT MANAGER -->
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
     
    <!-- SIDEBAR -->
    <div id="sidebar">
        <h3>How to use these tools</h3>
        <p>These tools allow administrators to add and edit the online charge forms used by Physicians, APNs and RNs to enter Outpatient Charges.</p>
        <br /><br />
        <asp:Panel runat="server" ID="pnlMeta">
        <h3>Who can access this tool?</h3>
        <asp:GridView runat="server" ShowHeader="false" id="gvMetaUsers" GridLines="None" CssClass="gvPlain"></asp:GridView>
        </asp:Panel>
    </div>
    <!-- SIDEBAR -->
     
    <!-- CONTENT -->
    <div id="main">
        <h2>Outpatient Charges Management Tools</h2>
        <p>Manage online outpatient charges forms</p>
 
        <label>Clinic:</label>
        <%--<asp:DropDownList ID="ddlEditClinic" runat="server" DataSourceID="ddlClinicsDatasource" DataTextField="name" DataValueField="mnemonic" AutoPostBack="true">
        </asp:DropDownList>--%>
        <asp:DropDownList ID="ddlEditClinic" runat="server" AutoPostBack="true">
            <asp:ListItem Text="ER" Value="ER"></asp:ListItem>
        </asp:DropDownList>
        <asp:SqlDataSource ID="ddlClinicsDatasource" runat="server" ConnectionString="<%$ ConnectionStrings:DataRepoConnectionString %>" SelectCommand="pOutpatientCharges_Get_Clinics" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
          
 
        <label>Category:</label>
        <asp:DropDownList ID="ddlEditCategory" runat="server" OnSelectedIndexChanged="ddlEditCategory_SelectedIndexChanged" AutoPostBack="true">
            <asp:ListItem Text="PHY" Value="PHY"></asp:ListItem>
            <asp:ListItem Text="APN" Value="APN"></asp:ListItem>
            <asp:ListItem Text="RN" Value="RN"></asp:ListItem>
        </asp:DropDownList>
        <br /><br />
 
        <%--User status updates--%>
        <asp:Panel ID="pnlError" runat="server" Visible="false">
            <div class="alert-box error"><span>ERROR: </span>There was an error processing your request.</div>
        </asp:Panel>
 
        <asp:Panel ID="pnlSuccessInsert" runat="server" Visible="false">
            <div class="alert-box success"><span>SUCCESS: </span>Your new record was inserted.</div>
        </asp:Panel>
 
        <asp:Panel ID="pnlSuccessUpdate" runat="server" Visible="false">
            <div class="alert-box success"><span>SUCCESS: </span>Your record was updated.</div>
        </asp:Panel>
 
        <asp:Panel ID="pnlSuccessDelete" runat="server" Visible="false">
            <div class="alert-box success"><span>SUCCESS: </span>Your record was deleted.</div>
        </asp:Panel>
 
 
     
 
 
         
         
         
        <!-- TAB STRIP -->
        <telerik:RadTabStrip ID="rtsOutptChgsMain" runat="server" MultiPageID="mpOutptChgsMain" SelectedIndex="0">
            <Tabs>
                <telerik:RadTab Text="Charges" PageViewID="pvCharges" Selected="true" TabIndex="0"/>
                <telerik:RadTab Text="Modifiers" PageViewID="pvModifiers" TabIndex="1"/>
                <telerik:RadTab Text="Requirements" PageViewID="pvRequirements" TabIndex="2"/>
                <telerik:RadTab Text="Exclusions" PageViewID="pvExclusions" TabIndex="3"/>
                <telerik:RadTab Text="Sorting" PageViewID="pvSorting" TabIndex="4"/>
                <telerik:RadTab Text="Action Log" PageViewID="pvOutptChgsLog" TabIndex="5"/>
            </Tabs>
        </telerik:RadTabStrip>
 
        <%--TOOLS--%>
        <telerik:RadMultiPage runat="server" ID="mpOutptChgsMain" CssClass="tools up" SelectedIndex="0">
 
            <%--TOOL: Charges--%>
            <telerik:RadPageView runat="server" ID="pvCharges">
                <h3>Charges</h3>
                <p id="pChargesInfo" runat="server"></p>
 
                <%--<label>I want to:</label>
                <asp:RadioButtonList ID="rblSelectMgmntType" runat="server" CssClass="rbl-horizontal" RepeatLayout="Flow" RepeatDirection="Horizontal" OnSelectedIndexChanged="rblSelectMgmntType_SelectedIndexChanged" AutoPostBack="true">           
                    <asp:ListItem Selected="True" Text="Copy" Value="copy"></asp:ListItem>
                    <asp:ListItem Text="Edit/Add" Value="edit"></asp:ListItem>
                </asp:RadioButtonList>
                <br /><br />--%>
 
                <%--Panel: Copy--%>
                <%--<asp:Panel ID="pnlChgCopy" runat ="server" Visible="false">
                    <label>pnlChgCopy</label><br /><br />
                    <label class="red">Coming soon...</label><br /><br />
                </asp:Panel>--%>
 
                <%--Panel: New--%>
                <%--<asp:Panel ID="pnlChgEdit" runat ="server" Visible="true">--%>             
                    <telerik:RadGrid ID="rgvEdit" runat="server" AutoGenerateColumns="False" CellSpacing="0" allowpaging="True" PageSize="75"
                        GridLines="None" style="margin-top: 0px" RegisterWithScriptManager="False" DataSourceID="dsGetChargeForms">
                         
                        <MasterTableView NoMasterRecordsText="No locations found." CommandItemDisplay="Top" PageSize="75" AllowPaging="true" AllowSorting="false" DataKeyNames="id" InsertItemPageIndexAction="ShowItemOnCurrentPage">
                            <CommandItemSettings ShowAddNewRecordButton="true" AddNewRecordText="Add New" ShowRefreshButton="false"/>
                            <Columns>   
                                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"/>                                 
                                <telerik:GridBoundColumn HeaderText="Subcategory" DataField="subcategory" UniqueName="subcategory" />
                                <telerik:GridBoundColumn DataField="bar_procedure_code" HeaderText="Proc Code"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="display_code" HeaderText="Display Code" SortExpression="display_code" UniqueName="display_code"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="description" HeaderText="Description" SortExpression="description" UniqueName="description"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="min" HeaderText="Min" SortExpression="min" UniqueName="min"></telerik:GridBoundColumn>
                                <telerik:GridCheckBoxColumn DataField="requires_modifier" DataType="System.Boolean" HeaderText="Modifer?" SortExpression="requires_modifier" UniqueName="requires_modifier"></telerik:GridCheckBoxColumn>
                                <telerik:GridCheckBoxColumn DataField="requires_epsdt" DataType="System.Boolean" HeaderText="EPSDT?" SortExpression="requires_epsdt" UniqueName="requires_epsdt"></telerik:GridCheckBoxColumn>
                                <telerik:GridCheckBoxColumn DataField="requires_contraceptive_mgmnt" DataType="System.Boolean" HeaderText="Cont. Mgmt?" SortExpression="requires_contraceptive_mgmnt" UniqueName="requires_contraceptive_mgmnt"></telerik:GridCheckBoxColumn>
                                <telerik:GridCheckBoxColumn DataField="no_md_charge" DataType="System.Boolean" HeaderText="No MD?" HeaderTooltip="No MD Charge" UniqueName="no_md_charge"></telerik:GridCheckBoxColumn>
                                <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton" />
                            </Columns>                           
                            <EditFormSettings UserControlName="OutptMgmtEditChgFormDetail.ascx" EditFormType="WebUserControl" EditColumn-UniqueName="OutptMgmtEditChgFormDetailCommand1">
                            </EditFormSettings>
                        </MasterTableView>
 
                        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                        </HeaderContextMenu>
                    </telerik:RadGrid>
 
                    <%--Datasources--%>
                    <asp:SqlDataSource ID="dsGetChargeForms" runat="server" ConnectionString="<%$ ConnectionStrings:OutpatientChargesConnectionString %>" SelectCommand="pSDGenie_OutpatientCharges_Get_ChargeForms" SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="ddlEditClinic" DefaultValue="" Name="Clinic" PropertyName="SelectedValue" Type="String" />
                            <asp:ControlParameter ControlID="ddlEditCategory" DefaultValue="" Name="Category" PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
 
                    <asp:SqlDataSource ID="dsGetSubcategories" runat="server" ConnectionString="<%$ ConnectionStrings:OutpatientChargesConnectionString %>" SelectCommand="pSDGenie_OutpatientCharges_Get_Subcategories" SelectCommandType="StoredProcedure">
                    </asp:SqlDataSource>
                <%--</asp:Panel>--%>
 
            </telerik:RadPageView>
 
            <%--TOOL: Modifiers--%>
            <telerik:RadPageView runat="server" ID="pvModifiers">
                <h3>Modifiers</h3>
                <p id="pModifiersInfo" runat="server"></p>
                <label class="red">Coming soon...</label>
            </telerik:RadPageView>
 
            <%--TOOL: Requirements--%>
            <telerik:RadPageView runat="server" ID="pvRequirements">
                <h3>Requirements</h3>
                <p id="pRequirementsInfo" runat="server"></p>
                <label class="red">Coming soon...</label>
            </telerik:RadPageView>
 
            <%--TOOL: Exclusions--%>
            <telerik:RadPageView runat="server" ID="pvExclusions">
                <h3>Exclusions</h3>
                <p id="pExclusionsInfo" runat="server"></p>
                <label class="red">Coming soon...</label>
 
                 
 
                <label>Pick a BAR Procedure Code from the drop down list then select the other BAR Procedure Codes to exclude when it is selected for billing.</label><br /><br />
 
                <label>NOTE: All BAR Procedure Codes must be added to the Dict_Charge_Form_Defaults table in the OutpatientCharges database for the Clinic/Category selected above before they will be available in the dropdown.</label><br /><br />
 
                <label>BAR Procedure Code:</label>
                <asp:DropDownList ID="ddlExclusionsBarProcCode" runat="server" AutoPostBack="true" EnableViewState="true" >
 
                </asp:DropDownList>
 
                <telerik:RadGrid ID="rgvEditExclusions" runat="server" AutoGenerateColumns="False" CellSpacing="0" GridLines="None" style="margin-top: 0px"
                    RegisterWithScriptManager="False" DataSourceID="dsExclusionsBarProcCodes" >                       
                        <MasterTableView NoMasterRecordsText="No locations found." CommandItemDisplay="TopAndBottom" DataSourceID="dsExclusionsBarProcCodes">
                            <CommandItemSettings ShowAddNewRecordButton="false"/>
                            <Columns>
                               <telerik:GridTemplateColumn>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="cbxExcludeBarProcCode" runat="server" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn HeaderText="Subcategory" DataField="subcategory" />
                                <telerik:GridBoundColumn HeaderText="BAR Proc Code" DataField="bar_procedure_code"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn HeaderText="Description" DataField="description" ></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn HeaderText="Display Code" DataField="display_code" ></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn HeaderText="ID" DataField="id" DataType="System.Int32" ReadOnly="True">
                                </telerik:GridBoundColumn>
                            </Columns>
                         </MasterTableView>
  
                </telerik:RadGrid>
 
                <asp:LinkButton ID="btnSubmitExclusions" runat="server" >Submit</asp:LinkButton>
 
 
 
 
                <asp:SqlDataSource ID="dsExclusionsBarProcCodes" runat="server" ConnectionString="<%$ ConnectionStrings:OutpatientChargesConnectionString %>" SelectCommand="pSDGenie_OutpatientCharges_Get_Exclusions_BarProcCodes" SelectCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddlEditClinic" Name="Clinic" PropertyName="SelectedValue" Type="String" />
                        <asp:ControlParameter ControlID="ddlEditCategory" Name="Category" PropertyName="SelectedValue" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
 
 
 
 
            </telerik:RadPageView>
 
            <%--TOOL: Sorting--%>
            <telerik:RadPageView runat="server" ID="pvSorting">
                <h3>Sorting</h3>
                <p id="pSortingInfo" runat="server"></p>
                <label class="red">Coming soon...</label>
            </telerik:RadPageView>
 
            <%--TOOL: Action Log--%>
            <telerik:RadPageView runat="server" ID="pvOutptChgsLog">
                <h3>Action Log</h3>
                <p>The following action log displays a list of actions completed in SDGenie.</p>
                <asp:GridView runat="server" ID="gvActionLog" GridLines="None" AutoGenerateColumns="false" CssClass="gv gvLog" AlternatingRowStyle-BackColor="#F7F7F7" PagerStyle-CssClass="gvPaging" AllowPaging="true" PageSize="20">
                    <Columns>
                        <asp:BoundField DataField="ActionType" HeaderText="Action" HeaderStyle-CssClass="first" ItemStyle-Wrap="false" ItemStyle-CssClass="first" />
                        <asp:BoundField DataField="ActionDesc" HeaderText="Description" />
                        <asp:BoundField DataField="ActionTime" HeaderText="Action Time" DataFormatString="{0:MM/dd/yy hh:mm tt}" ItemStyle-Wrap="false" HeaderStyle-CssClass="last" ItemStyle-CssClass="last" />
                    </Columns>
                    <EmptyDataTemplate>
                        <table style="width: 100%; text-align: center;">
                            <tr>
                                <th>No actions have been logged yet.</th>
                            </tr>
                        </table>
                    </EmptyDataTemplate>
                    <PagerSettings Mode="NumericFirstLast" Position="Bottom" />
                </asp:GridView>
            </telerik:RadPageView>
 
        </telerik:RadMultiPage>
     
 
 
 
 
 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="rgvEdit">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rgvEdit" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="gvActionLog" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="50" BackColor="Gray">
        </telerik:RadAjaxLoadingPanel>
 
    </div>
</asp:Content>



Here is the webpage codebehind:



Imports Telerik.Web.UI
 
Public Class OutptMgmt
    Inherits System.Web.UI.Page
 
#Region "Variables"
 
    Const ApplicationID As Integer = 506
    Private errorType As String = "Outpatient Charges Management Tools"
    Private errorMessage As String
 
    Protected process As New Process()
    Protected OCTools As New OutpatientChargesTools
 
 
    Private ReadOnly Property Username() As String
        Get
            Return Process.UserInfo_SDGenieUserName()
        End Get
    End Property
 
    Private ReadOnly Property SDGenieUserID() As Integer
        Get
            Return Process.UserInfo_SDGenieUID()
        End Get
    End Property
 
    Private ReadOnly Property UID() As String
        Get
            Return Process.UserInfo_SDGenieUserMeditechID()
        End Get
    End Property
 
#End Region
 
#Region "Page Load/Identity Check"
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Initial page load
        If Not Page.IsPostBack Then
            Check_UserAccess()
            'Build_ActionLogList(True)
            Me.LoadPage()
        End If
 
    End Sub
 
    Protected Sub Check_UserAccess()
        Dim CanUserAccess As Boolean = False
        Try
            'Read the user's cookies to verify they belong on this page
 
            Dim SDGenieUID As Integer = Process.UserInfo_SDGenieUID()
            Dim IsAdmin As Boolean = Process.UserInfo_IsUserAdmin()
 
            'Verify the current user has access to this tool. Admins are excluded since they can do anything.
            CanUserAccess = Process.Verify_UserAccess(SDGenieUID, ApplicationID, IsAdmin)
            If IsAdmin Then
                Me.pnlMeta.Visible = True
                Dim li As List(Of String) = Process.UserAccess_WhoCanAccessSingleApplication(ApplicationID)
                Me.gvMetaUsers.DataSource = li
                Me.gvMetaUsers.DataBind()
            Else
                Me.pnlMeta.Visible = False
            End If
        Catch ex As Exception
            'Redirect them to the login page... the cookies were expired or not found.
            Response.Redirect("~/Login.aspx")
        End Try
 
        If CanUserAccess = False Then
            Response.Redirect("~/AccessDenied.aspx")
        End If
 
    End Sub
 
    Protected Sub LoadPage()
        Me.ddlEditClinic.DataBind()
        Me.rtsOutptChgsMain.DataBind()
        'Me.BindData()
    End Sub
#End Region
 
#Region "  Tools  "
 
    Protected Sub rtsOutptChgsMain_TabClick(sender As Object, e As RadTabStripEventArgs)
        'Me.BindData()
        Me.UpdateUser()
    End Sub
 
    Private Sub rtsOutptChgsMain_Load(sender As Object, e As EventArgs) Handles rtsOutptChgsMain.Load
        'Me.BindData()
    End Sub
 
    Protected Sub ddlEditCategory_SelectedIndexChanged(sender As Object, e As EventArgs)
        Me.UpdateUser()
        'Me.BindData()
    End Sub
 
    'Protected Sub BindData()
    '    Select Case Me.rtsOutptChgsMain.SelectedIndex
    '        Case 0 'Charges tab
    '            'Me.ToggleChargePanels()
    '            Me.pChargesInfo.InnerText = String.Format("Add or edit online charge forms for {0} ({1})", Me.ddlEditClinic.SelectedItem.Text, Me.ddlEditCategory.SelectedItem.Text)
 
    '            Dim dt As DataTable = OCTools.GetChargeForms(Me.ddlEditClinic.SelectedItem.Value, Me.ddlEditCategory.SelectedItem.Value)
    '            Me.rgvEdit.DataSource = dt
    '            Me.rgvEdit.DataBind()
    '        Case 1
 
    '            Me.pModifiersInfo.InnerText = String.Format("Add or edit charge modifiers used by {0} ({1})", Me.ddlEditClinic.SelectedItem.Text, Me.ddlEditCategory.SelectedItem.Text)
    '        Case 2
 
 
    '            Me.pRequirementsInfo.InnerText = String.Format("Require a diagnosis when a patient is charged by {0} ({1})", Me.ddlEditClinic.SelectedItem.Text, Me.ddlEditCategory.SelectedItem.Text)
    '        Case 3
 
    '            Me.pExclusionsInfo.InnerText = String.Format("Prevent charges from being selected together in {0} ({1})", Me.ddlEditClinic.SelectedItem.Text, Me.ddlEditCategory.SelectedItem.Text)
 
    '            Dim dt As DataTable = OCTools.GetExclusionsBarProcCodes(Me.ddlEditClinic.SelectedItem.Value, Me.ddlEditCategory.SelectedItem.Value)
    '            Me.ddlExclusionsBarProcCode.DataSource = dt
    '            Me.ddlExclusionsBarProcCode.DataTextField = "display_text" ' dt.Columns(1).ToString
    '            Me.ddlExclusionsBarProcCode.DataValueField = "bar_procedure_code" 'dt.Columns(0).ToString
    '            Me.ddlExclusionsBarProcCode.DataBind()
 
    '            Me.ddlExclusionsBarProcCode.DataSource = dt
    '            Me.rgvEditExclusions.DataBind()
 
    '        Case 4
 
    '            Me.pSortingInfo.InnerText = String.Format("Set sort orders for subcategories on the online charge forms used by {0} ({1})", Me.ddlEditClinic.SelectedItem.Text, Me.ddlEditCategory.SelectedItem.Text)
 
    '        Case 5
    '            Me.Build_ActionLogList(True)
 
    '        Case Else
 
    '    End Select
    'End Sub
 
#Region "Charges Tools"
 
 
 
    'Protected Sub ToggleChargePanels()
    '    Me.UpdateUser()
    '    Me.pnlChgCopy.Visible = (Me.rblSelectMgmntType.SelectedIndex = 0)
    '    Me.pnlChgEdit.Visible = (Me.rblSelectMgmntType.SelectedIndex = 1)
    'End Sub
 
    'Protected Sub rblSelectMgmntType_SelectedIndexChanged(sender As Object, e As EventArgs)
    '    Me.ToggleChargePanels()
 
    '    Select Case Me.rblSelectMgmntType.SelectedIndex
    '        Case 0 'Copy
 
    '        Case 1 'Edit
    '            Me.rgvEdit.DataBind()
    '    End Select
    'End Sub
 
 
#End Region
 
 
#End Region
 
#Region " Action Log "
 
    Protected Sub Log(ByVal Title As String, ByVal Message As String)
        process.Logging_WriteActionLogEntry(ApplicationID, Me.SDGenieUserID, Title, Message)
    End Sub
 
    Protected Sub Build_ActionLogList(ByVal databind As Boolean)
        Dim actionList As List(Of ActionLogInfo) = Process.General_SDGenie_GetActionLog(ApplicationID)
        Me.gvActionLog.DataSource = actionList
        If databind Then
            Me.gvActionLog.DataBind()
        End If
    End Sub
 
    Protected Sub gvActionLog_PageIndexChanging(ByVal sender As Object, ByVal e As GridViewPageEventArgs) Handles gvActionLog.PageIndexChanging
        Build_ActionLogList(False)
        Me.gvActionLog.PageIndex = e.NewPageIndex
        Me.gvActionLog.DataBind()
    End Sub
 
#End Region
 
 
 
 
 
 
    Private Sub rgvEdit_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles rgvEdit.ItemCommand
        Select Case e.CommandName
            Case "PerformInsert"
                Dim MyUserControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)
 
                If MyUserControl IsNot Nothing Then
                    'Insert
                    Dim chgId As Integer 'ToDo: get charge id
 
                    Dim subcategory As String = TryCast(MyUserControl.FindControl("ddlSubcategories"), DropDownList).SelectedValue
                    Dim procedureCode As String = TryCast(MyUserControl.FindControl("txtProcedureCode"), TextBox).Text
                    Dim displayCode As String = TryCast(MyUserControl.FindControl("txtDisplayCode"), TextBox).Text
                    Dim description As String = TryCast(MyUserControl.FindControl("txtDescription"), TextBox).Text
                    Dim minutes As String = TryCast(MyUserControl.FindControl("txtMinutes"), TextBox).Text
                    Dim blnModifier As Boolean = TryCast(MyUserControl.FindControl("cbxRequiresModifier"), CheckBox).Checked
                    Dim blnEpsdt As Boolean = TryCast(MyUserControl.FindControl("cbxRequiresEPSDT"), CheckBox).Checked
                    Dim blnContMgmt As Boolean = TryCast(MyUserControl.FindControl("cbxRequiresContraceptiveMgmt"), CheckBox).Checked
                    Dim blnNoMd As Boolean = TryCast(MyUserControl.FindControl("cbxNoMdCharge"), CheckBox).Checked
                    Dim userMeditechId As String = process.UserInfo_SDGenieMeditechID
 
                    If IsNumeric(minutes) = False Then
                        minutes = "0"
                    End If
 
                    If OCTools.AddChargeFormDefaultValue(Me.ddlEditClinic.SelectedValue, Me.ddlEditCategory.SelectedValue, subcategory, procedureCode, displayCode, description, minutes, blnModifier, blnEpsdt, blnContMgmt, blnNoMd) = True Then
                        Log("Inserted New Charge Info", String.Format("{0} inserted new charge info with ID {1}", process.UserInfo_SDGenieUserName, chgId))
                        Me.UpdateUser("Insert")
                    Else
                        Me.UpdateUser("Error")
                    End If
                End If
            Case "Update"
                Dim MyUserControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)
 
                If MyUserControl IsNot Nothing Then
                    Dim id As String = TryCast(MyUserControl.FindControl("lblID"), Label).Text
                    Dim subcategory As String = TryCast(MyUserControl.FindControl("ddlSubcategories"), DropDownList).SelectedValue
                    Dim procedureCode As String = TryCast(MyUserControl.FindControl("txtProcedureCode"), TextBox).Text
                    Dim displayCode As String = TryCast(MyUserControl.FindControl("txtDisplayCode"), TextBox).Text
                    Dim description As String = TryCast(MyUserControl.FindControl("txtDescription"), TextBox).Text
                    Dim minutes As String = TryCast(MyUserControl.FindControl("txtMinutes"), TextBox).Text
                    Dim blnModifier As Boolean = TryCast(MyUserControl.FindControl("cbxRequiresModifier"), CheckBox).Checked
                    Dim blnEpsdt As Boolean = TryCast(MyUserControl.FindControl("cbxRequiresEPSDT"), CheckBox).Checked
                    Dim blnContMgmt As Boolean = TryCast(MyUserControl.FindControl("cbxRequiresContraceptiveMgmt"), CheckBox).Checked
                    Dim blnNoMd As Boolean = TryCast(MyUserControl.FindControl("cbxNoMdCharge"), CheckBox).Checked
                    Dim userMeditechId As String = process.UserInfo_SDGenieMeditechID
 
                    If OCTools.UpdChargeFormDefaultValue(CInt(id), subcategory, procedureCode, displayCode, description, minutes, blnModifier, blnEpsdt, blnContMgmt, blnNoMd) = True Then
                        Log("Updated Charge Info", String.Format("{0} updated charge info with ID {1}", process.UserInfo_SDGenieUserName, id))
                        Me.UpdateUser("Update")
                    Else
                        Me.UpdateUser("Error")
                    End If
                End If
            Case "Delete"
                Dim id As Integer = 0
                Try
                    id = DirectCast((DirectCast(e.Item, GridDataItem)).GetDataKeyValue("id"), Integer)
                Catch ex As Exception
                End Try
 
                If id > 0 Then
                    If OCTools.DelChargeFormDefaultValue(id) = True Then
                        Log("Deleted Charge Info", String.Format("{0} deleted charge info with ID {1}", process.UserInfo_SDGenieUserName, id))
                        Me.UpdateUser("Delete")
                    Else
                        Me.UpdateUser("Error")
                    End If
                End If
            Case Else
                'Do Nothing
        End Select
    End Sub
 
    Private Sub UpdateUser(Optional updateType As String = "")
        Me.pnlError.Visible = False
        Me.pnlSuccessInsert.Visible = False
        Me.pnlSuccessUpdate.Visible = False
        Me.pnlSuccessDelete.Visible = False
 
        If updateType = "" Then Exit Sub
 
        Select Case updateType
            Case "Error"
                Me.pnlError.Visible = True
            Case "Insert"
                Me.pnlSuccessInsert.Visible = True
            Case "Update"
                Me.pnlSuccessUpdate.Visible = True
            Case "Delete"
                Me.pnlSuccessDelete.Visible = True
        End Select
    End Sub
 
 
    Private Sub ddlExclusionsBarProcCode_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlExclusionsBarProcCode.SelectedIndexChanged
        Me.ddlExclusionsBarProcCode.DataSource = OCTools.GetExclusionsBarProcCodes(Me.ddlEditClinic.SelectedItem.Value, Me.ddlEditCategory.SelectedItem.Value)
 
        Me.rgvEditExclusions.DataBind()
    End Sub
 
 
    Private Sub rgvEdit_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs) Handles rgvEdit.NeedDataSource
        Select Case Me.rtsOutptChgsMain.SelectedIndex
            Case 0 'Charges tab
                'Me.ToggleChargePanels()
                Me.pChargesInfo.InnerText = String.Format("Add or edit online charge forms for {0} ({1})", Me.ddlEditClinic.SelectedItem.Text, Me.ddlEditCategory.SelectedItem.Text)
 
                'Dim dt As DataTable = OCTools.GetChargeForms(Me.ddlEditClinic.SelectedItem.Value, Me.ddlEditCategory.SelectedItem.Value)
                'Me.rgvEdit.DataSource = dt
                'Me.rgvEdit.DataBind()
            Case 1
 
                Me.pModifiersInfo.InnerText = String.Format("Add or edit charge modifiers used by {0} ({1})", Me.ddlEditClinic.SelectedItem.Text, Me.ddlEditCategory.SelectedItem.Text)
            Case 2
 
 
                Me.pRequirementsInfo.InnerText = String.Format("Require a diagnosis when a patient is charged by {0} ({1})", Me.ddlEditClinic.SelectedItem.Text, Me.ddlEditCategory.SelectedItem.Text)
            Case 3
 
                Me.pExclusionsInfo.InnerText = String.Format("Prevent charges from being selected together in {0} ({1})", Me.ddlEditClinic.SelectedItem.Text, Me.ddlEditCategory.SelectedItem.Text)
 
                Dim dt As DataTable = OCTools.GetExclusionsBarProcCodes(Me.ddlEditClinic.SelectedItem.Value, Me.ddlEditCategory.SelectedItem.Value)
                Me.ddlExclusionsBarProcCode.DataSource = dt
                Me.ddlExclusionsBarProcCode.DataTextField = "display_text" ' dt.Columns(1).ToString
                Me.ddlExclusionsBarProcCode.DataValueField = "bar_procedure_code" 'dt.Columns(0).ToString
                Me.ddlExclusionsBarProcCode.DataBind()
 
                Me.ddlExclusionsBarProcCode.DataSource = dt
                'Me.rgvEditExclusions.DataBind()
 
            Case 4
 
                Me.pSortingInfo.InnerText = String.Format("Set sort orders for subcategories on the online charge forms used by {0} ({1})", Me.ddlEditClinic.SelectedItem.Text, Me.ddlEditCategory.SelectedItem.Text)
 
            Case 5
                Me.Build_ActionLogList(True)
 
            Case Else
 
        End Select
    End Sub
End Class



Here is the WebUserControl
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="OutptMgmtEditChgFormDetail.ascx.vb" Inherits="SDGenie.OutptMgmtEditChgFormDetail" %>
 
<table style="width:100%; border-collapse:collapse">
    <tr>
        <td>
            <H3 id ="h3Header" runat="server">Edit Charge Details</H3>
 
            <b>ID:</b
            <asp:Label ID="lblID" runat="server" Text='<%# Eval("id")%>' ></asp:Label>
            <br />
            <b>Subcategory:</b>       
            <asp:DropDownList ID="ddlSubcategories" runat="server" DataSourceID="dsGetSubcategories" datatextfield="subcategory" datavaluefield="subcategory" Width="200" Text='<%# CleanData(Eval("Subcategory"))%>'></asp:DropDownList>
            <br />
            <b>Procedure Code:</b
            <asp:TextBox ID="txtProcedureCode" runat="server" Text='<%# Eval("bar_procedure_code")%>' Width="196"></asp:TextBox>
            <asp:RequiredFieldValidator id="rfvtxtProcedureCode" runat="server" ControlToValidate="txtProcedureCode" Display="dynamic" ForeColor="Red">*Required</asp:RequiredFieldValidator>
            <br />
            <b>Display Code:</b>       
            <asp:TextBox ID="txtDisplayCode" runat="server" Text='<%# Eval("display_code")%>' Width="196"></asp:TextBox>
            <asp:RequiredFieldValidator id="rfvtxtDisplayCode" runat="server" ControlToValidate="txtDisplayCode" Display="dynamic" ForeColor="Red">*Required</asp:RequiredFieldValidator>
            <br />
            <b>Description:</b>         
            <asp:TextBox ID="txtDescription" runat="server" Text='<%# Eval("description")%>' Width="196"></asp:TextBox>
            <asp:RequiredFieldValidator id="rfvtxtDescription" runat="server" ControlToValidate="txtDescription" Display="dynamic" ForeColor="Red">*Required</asp:RequiredFieldValidator>
            <br />
            <b>Minutes:</b>               
            <asp:TextBox ID="txtMinutes" runat="server" Text='<%# Eval("min")%>' Width="30"></asp:TextBox>
            <br /><br />
            <b>Require Modifier:</b>  
            <asp:CheckBox ID="cbxRequiresModifier" runat="server" Checked='<%# CleanBooleanData(Eval("requires_modifier"))%>'/>
            <br />
            <b>Require EPSDT:</b>      
            <asp:CheckBox ID="cbxRequiresEPSDT" runat="server" Checked='<%# CleanBooleanData(Eval("requires_epsdt"))%>' />
            <br />
            <b>Require Contraceptive Management Dx:</b
            <asp:CheckBox ID="cbxRequiresContraceptiveMgmt" runat="server" Checked='<%# CleanBooleanData(Eval("requires_contraceptive_mgmnt"))%>' />
            <br />
            <b>No MD Charge:</b>       
            <asp:CheckBox ID="cbxNoMdCharge" runat="server" Checked='<%# CleanBooleanData(Eval("no_md_charge"))%>'/>
        </td>
    </tr>
 
   <tr>
        <td style="float:right;padding:5px;" colspan="2">
            <asp:Button ID="btnUpdate" Text="Update" runat="server" CommandName="Update"
                Visible='<%# Not (TypeOf DataItem Is Telerik.Web.UI.GridInsertionObject) %>'>
            </asp:Button>
            <asp:Button ID="btnInsert" Text="Insert" runat="server" CommandName="PerformInsert"
                Visible='<%# (TypeOf DataItem Is Telerik.Web.UI.GridInsertionObject) %>'></asp:Button>
              
            <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button>
        </td>
    </tr>
</table>
 
<%--Datasources--%>
<asp:SqlDataSource ID="dsGetSubcategories" runat="server" ConnectionString="<%$ ConnectionStrings:OutpatientChargesConnectionString %>" SelectCommand="pSDGenie_OutpatientCharges_Get_Subcategories" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>


Here is the WebUserControl codebehind:


Public Class OutptMgmtEditChgFormDetail
    Inherits System.Web.UI.UserControl
 
    Private _dataItem As Object = Nothing
    Public Property DataItem() As Object
        Get
            Return Me._dataItem
        End Get
        Set(ByVal value As Object)
            Me._dataItem = value
        End Set
    End Property
 
    Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        If TypeOf (DataItem) Is Telerik.Web.UI.GridInsertionObject Then
            Me.h3Header.InnerText = "Insert Charge Detail"
        Else
            Me.h3Header.InnerText = "Edit Charge Detail"
        End If
    End Sub
 
    Public Function CleanData(dataItemValue As Object) As String
        If TypeOf (DataItem) Is Telerik.Web.UI.GridInsertionObject Then
            Dim dv As DataView = DirectCast(dsGetSubcategories.[Select](DataSourceSelectArguments.Empty), DataView)
            Return dv(0)("subcategory")
        Else
            Return dataItemValue
        End If
    End Function
 
    Public Function CleanBooleanData(dataItemValue As Object) As Boolean
        If TypeOf (DataItem) Is Telerik.Web.UI.GridInsertionObject Then
            Return False
        Else
            Return dataItemValue.ToString.ToBool
        End If
    End Function
 
End Class

Thanks.
0
southwynd
Top achievements
Rank 1
answered on 26 Jun 2014, 03:34 PM
I figured out the problem.  I had removed this from my telerik:RadGrid.  Evidently it is needed.

                    <ClientSettings>
                        <ClientEvents OnRowDblClick="RowDblClick" /> <%--Not sure what this does but it allows rgvEdit.ItemCommand to fire--%>
                    </ClientSettings>
Tags
Grid
Asked by
southwynd
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
southwynd
Top achievements
Rank 1
Share this question
or