<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/FiniqAppMasterPage.Master" CodeBehind="RMWorkstationMetadata.aspx.vb" Inherits="FinIQWebApp.RMWorkstationMetadata" %>

<%@ Register Src="Smart_Search_Control_RMWMetadata/RMWMetadata_TargetField_SmartSearch.ascx" TagPrefix="ucRMWMetadata" TagName="RMWMetadata_TargetField_SmartSearch" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script src="Smart_Search_Control_RMWMetadata/TargetFieldSmartSearch.js"></script>
    <script src="RMWorkstationMetadata.js" type="text/javascript"></script>
    <link href="RMWorkstationMetadata.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">

        function draggable() {
            $(function () {
                $("#<%=pnlPreview.ClientID%>").draggable();
            });
        }

        $(document).ready(function () {
            $("#overlayPreview").css("z-index", "0");
        });

        function SetFieldsOnDataGridView(id, valueSet) {
            try {
                console.log(id);
                console.log(valueSet);
                if (id <= 9)
                    document.getElementById("ctl00_MainContent_grdData_ctl0" + id + "_RMWMetadata_TargetField_SmartSearch1_txtAutomplete").value = valueSet;
                else
                    document.getElementById("ctl00_MainContent_grdData_ctl" + id + "_RMWMetadata_TargetField_SmartSearch1_txtAutomplete").value = valueSet;
            }
            catch (err) {
                console.log(err.message);
            }
            finally { }

        }

        function changeSize(that) {
            try {
                if (that.value == "+") {
                    $(that).parent().find('.changeSizeTextBox')[0].value = parseInt($(that).parent().find('.changeSizeTextBox')[0].value) + 1
                }
                else if ($(that).parent().find('.changeSizeTextBox')[0].value > 0) {
                    $(that).parent().find('.changeSizeTextBox')[0].value = parseInt($(that).parent().find('.changeSizeTextBox')[0].value) - 1
                }
            }
            catch (err) {
                console.log(err.message);
            }
        }

        function isNumberKey(evt) {
            try {
                var charCode = (evt.which) ? evt.which : evt.keyCode;

                if (charCode > 31 && (charCode < 48 || charCode > 57))
                    return false;
                return true;
            }
            catch (err) {
                console.log(err.message);
            }
        }

        function ShowCSSStylePanel(RowP) {
            try {
                document.getElementById('<%=btnShowPanel.ClientID%>').click()
                console.log($("#" + event.target.id).offset().top);
                localStorage.setItem("topHeight", $("#" + event.target.id).offset().top);
            }
            catch (err) {
                console.log(err.message);
            }
        }

        function checkAll(chkAll) {
            try {
                var GridView = chkAll.parentNode.parentNode.parentNode;
                var inputList = GridView.getElementsByTagName("input");

                for (var i = 0; i < inputList.length; i++) {

                    var row = inputList[i].parentNode.parentNode;
                    if (inputList[i].type == "checkbox" && chkAll != inputList[i]) {
                        if (chkAll.checked) {
                            inputList[i].checked = true;
                        }
                        else {
                            inputList[i].checked = false;
                        }
                    }
                }
            }
            catch (err) {
                console.log(err.message);
            }
            finally { }
        }

        function AllowAlphaNumericAndDotOnly(e) {
            try {
                var keycode;
                if (window.event)
                    keycode = window.event.keyCode;
                else if (event)
                    keycode = event.keyCode;
                else if (e)
                    keycode = e.which;
                else return true;
                if ((keycode >= 48 && keycode <= 57) || (keycode == 46)) { return true; }
                else { return false; } return true;
            }
            catch (err) {
                console.log(err.message);
            }
        }

        function ApplyFliter() {
            try {
                document.getElementById("ctl00_MainContent_btnLoad").click();
            }
            catch (err) {
                console.log(err.message);
            }
            finally {
            }

        }

        function OpenVideopopUp() {
            try {
                document.getElementById("overlayDiv").style.display = "block";
            }
            catch (err) {
                console.log(err.message);
            }
            finally {
            }
        }

        function OpenCSSPanelPopUp() {
            try {
                document.getElementById("overlayDivCssStyle").style.display = "block";
                console.log(localStorage.getItem("topHeight"));
                document.getElementById("ctl00_MainContent_pnlCssStyle").style.top = parseInt(localStorage.getItem("topHeight")) + 35;
            }
            catch (err) {
                console.log(err.message);
            }
            finally {
            }
        }

        function OpenMoreFiltersPopUp() {
            try {
                document.getElementById("overlayDivMoreFilters").style.display = "block";
            }
            catch (err) {
                console.log(err.message);
            }
            finally {
            }
        }

        function HidePreview() {
            $("#divPreview").hide(300);
            $("#overlayPreview").css("display", "none");
            //$('#ctl00_MainContent_pnlPreview').toggleClass('invisible');
            $('#ctl00_MainContent_pnlPreview').hide(300);
            //$('#ctl00_MainContent_pnlPreview').toggleClass('visible');
            $('#ctl00_MainContent_pnlPreview').toggleClass('VideoUploadPopup');
        }

    </script>

    <style>
        .BreakWord {
            overflow-wrap: break-word;
        }

        .divLoading {
            position: absolute;
            left: 1000px;
            top: 60px;
        }

        .Visible {
            display: block;
        }

        .invisible {
            display: none;
        }

        .btnGroupbox {
            width: 65px;
        }

        .divVerticalEditmain {
            background-color: #FFF;
            height: auto;
        }

        /*Added By Shubham Podhade on 30-Aug-2019*/
        .ui-widget.ui-widget-content {
            z-index: 9999999 !important;
            /*top: 1002px !important;*/ /*topp*/
        }

        .ui-widget-overlay {
            background: #666666 !important;
            opacity: .40 !important;
        }
        /*Added By Shubham Podhade on 30-Aug-2019*/

        .ui-dialog .ui-dialog-titlebar-close {
            position: absolute;
            right: 0.3em;
            width: 20px;
            margin: -10px 0 0 0;
            padding: 1px;
            height: 20px;
            top: 13px !important;
        }

        .GridHeader td, .GridHeader th, .GridHeader a {
            font: bold 11px verdana;
        }

            .GridHeader th:not(:first-child), .GridHeader td:not(:first-child) .GridHeaderTitle th:not(:first-child):hover, .GridHeader th:not(:first-child):hover, .GridHeader td:not(:first-child):hover {
                /*padding-right: 5px !important;*/
                font: bold 11px verdana;
                /*cursor: auto !important;*/
            }

        a:hover {
            font-size: 11px !important;
        }

        .linkButtonColour {
            color: #0284e0;
        }



        .GridItemSelect {
            background-color: #e7e7e7 !important;
        }

            .GridItemSelect td a:link {
                color: #0284e0 !important;
            }

        .groupBoxVideoUpload {
            position: absolute;
            height: auto;
            border: solid 1px #ccc;
            width: 250px;
            top: 305px !important;
            left: 750px !important;
            background: #ffffff !important;
        }

        .groupBoxCSSPanel {
            position: absolute;
            height: auto;
            width: 360px;
            /*top: 305px !important;*/
            left: 1515px !important;
            background: #ffffff !important;
        }

        .groupBoxMoreFilterPanel {
            position: absolute;
            height: auto;
            width: 675px;
            top: 200px !important;
            left: 620px !important;
            background: #ffffff !important;
        }

        .VideoUploadPopup {
            z-index: 10000000 !important;
        }

        .divVideoUploadMain {
            background-color: #FFF;
            height: auto;
        }

        .overlaySearch {
            z-index: -1;
            background-color: #000000; /* Black background with opacity */
        }

        .overlaySearch1 {
            position: fixed;
            display: none;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #FFF;
            opacity: 0.3;
            z-index: 2;
            cursor: pointer;
            background-color: black;
        }

        .myDisplayStyle {
            display: block;
        }

        .beautifyPopUpCssStyle {
            border-radius: 12px;
            box-shadow: 0 0 10px #0a0a0a;
        }

        .btnSize {
            width: 22px;
        }

        .btnClose {
            width: 25px;
            float: right;
        }


        .modal-dialog {
            position: absolute;
            top: 50% !important;
            transform: translate(0, -50%) !important;
            -ms-transform: translate(0, -50%) !important;
            -webkit-transform: translate(0, -50%) !important;
            margin: auto 5%;
            width: 90%;
            height: 80%;
        }

        .modal-content {
            min-height: 100%;
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
        }

        .modal-body {
            position: absolute;
            top: 45px; /** height of header **/
            bottom: 45px; /** height of footer **/
            left: 0;
            right: 0;
            overflow-y: auto;
        }

        .modal-footer {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
        }

        .alignPreviewPopUp {
            top: 35%;
            left: 8%;
            position: fixed !important;
        }

        .width1 {
            min-width: 150px;
            max-width: 150px;
        }

        .ui-dialog .ui-dialog-titlebar {
            opacity: 0.7;
            background-color: #ffffff !important;
            border: none;
        }

            .ui-dialog .ui-dialog-titlebar, .ui-dialog .ui-dialog-titlebar .ui-widget {
                background-color: #ffffff !important;
                border: none;
            }
    </style>

    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="Updatepanel1" DisplayAfter="0">
        <ProgressTemplate>
            <div class="divLoading">
                <img alt="Loading" src="../App_Resources/loading.gif" /><span class="lbl">Loading...&nbsp;&nbsp;
                </span>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>

    <table>
        <tr>
            <td>
                <asp:Button ID="dgvButton" CssClass="btn invisible" runat="server" Text="" />
            </td>
        </tr>
    </table>

    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <div id="mainDiv">
                <table>
                    <tr>
                        <td>
                            <asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="UpdatePanel2"
                                DisplayAfter="0">
                                <ProgressTemplate>
                                    <div class="divLoading">
                                        <img alt="Loading" src="../App_Resources/loading.gif" /><span class="lbl">Loading...&nbsp;&nbsp;
                                        </span>
                                    </div>
                                </ProgressTemplate>
                            </asp:UpdateProgress>
                        </td>
                    </tr>
                </table>

                <table>
                    <tr>
                        <td>
                            <asp:Label ID="lblError" runat="server" Text="" CssClass="lblError lblError1"></asp:Label>
                        </td>
                    </tr>
                </table>

                <table>
                    <tr>
                        <td>
                            <asp:Label ID="lblTemplateName" runat="server" Text="Template Name" CssClass="lbl"></asp:Label>
                        </td>
                        <td style="width: 10px"></td>
                        <td style="width: 350px">
                            <asp:DropDownList ID="ddlTemplateName" runat="server" AutoPostBack="True" CssClass="ddl" Visible="true"></asp:DropDownList>
                        </td>

                        <td style="width: 80px;">
                            <asp:Label ID="lbllayout" runat="server" Text="Layout Code" CssClass="lbl"></asp:Label>
                        </td>

                        <td>
                            <asp:DropDownList ID="ddlLayoutCode" AutoPostBack="True" runat="server" CssClass="ddl" Width="135px">
                            </asp:DropDownList>
                        </td>

                        <td>
                            <asp:DropDownList ID="ddlLayout" AutoPostBack="True" runat="server" CssClass="ddl" Visible="false">
                                <asp:ListItem Value="Old">1200 x 300</asp:ListItem>
                                <asp:ListItem Value="New">600 x 400</asp:ListItem>
                            </asp:DropDownList>
                        </td>

                        <td style="padding-right: 5px !important;">
                            <asp:Button ID="btnLoad" runat="server" Text="Load" CssClass="btn" Visible="false" Style="width: 80px" />
                        </td>
                        <td style="padding-right: 5px !important;">
                            <asp:Button ID="btnAdd" runat="server" Text="Add" CssClass="btn" Style="width: 80px" />
                        </td>
                        <td style="padding-right: 5px !important;">
                            <asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="btn" Style="width: 80px" OnClientClick="return confirm('Are you sure you want to delete existing record?');" />
                        </td>

                        <td style="padding-right: 5px !important;">
                            <asp:Button ID="btnExport" runat="server" Text="Export Scripts" CssClass="btn" Style="width: 90px" />
                        </td>
                        <td style="padding-right: 5px !important; display: none;">
                            <asp:Button ID="btnSave" runat="server" Visible="false" Text="Save" CssClass="btn" Style="width: 80px" />
                        </td>
                        <td style="display: none;">
                            <asp:Button ID="btnCancel" runat="server" Text="Cancel" Visible="false" CssClass="btn" Style="width: 80px" />
                        </td>
                        <td style="padding-right: 10px !important;">
                            <asp:Button ID="btnCopy" runat="server" Text="Copy To Template" CssClass="btn" Style="width: 120px" OnClientClick="return ShowClonePanel();" />
                        </td>
                        <td style="padding-right: 15px !important; display: none;">
                            <asp:LinkButton ID="linkBtnRMWGenMetaData" runat="server" CssClass="linkButtonColour" Text="Filter, Sorting, Action Link and Data Type Settings"></asp:LinkButton>
                        </td>
                        <td style="padding-right:10px;">
                            <asp:ImageButton runat="server" ID="imgBtnFilters" ImageUrl="~/App_Resources/FilterSettings.png" ToolTip="Filter Settings"  CssClass="SettingsIcons" OnClientClick="return OpenRMWGenericPopup(this);" Title="Filter Settings" Mode="Filter"/>
                        </td>
                        <td style="padding-right:10px;">
                            <asp:ImageButton runat="server" ID="imgBtnSorting" ImageUrl="~/App_Resources/SortFilters.png" ToolTip="Sorting Settings" CssClass="SettingsIcons" OnClientClick="return OpenRMWGenericPopup(this);" Title="Sorting Settings" Mode="Sorting" />
                        </td>
                        <td style="padding-right:10px;">
                            <asp:ImageButton runat="server" ID="imgBtnActionLinks" ImageUrl="~/App_Resources/ActionLinkSettings.png" ToolTip="Action Links" CssClass="SettingsIcons" OnClientClick="return OpenRMWGenericPopup(this);" Title="Action Link Settings" Mode="Actions" />
                        </td>
                        <td style="padding-right:10px;">
                            <asp:ImageButton runat="server" ID="imgBtnLayoutStyle" ImageUrl="~/App_Resources/LayoutStyle.png" ToolTip="Layout Style" CssClass="SortingIcon" OnClientClick="return OpenRMWGenericPopup(this);" Title="Layout Style Settings" Mode="LayoutStyle" />
                        </td>
                        <td style="padding-right:10px;">
                            <asp:ImageButton runat="server" ID="imgBtnLayout" ImageUrl="~/App_Resources/LayoutPreview.png" ToolTip="Layout Preview" CssClass="SettingsIcons" OnClientClick="return OpenLayoutPreview();" />
                        </td>
                        <td style="padding-right: 240px; display: none;">
                            <asp:LinkButton ID="linkbtnPreview" runat="server" CssClass="linkButtonColour" Text="Layout Preview" OnClientClick="return "></asp:LinkButton>
                        </td>

                        <td style="padding-right: 5px !important;">
                            <asp:Label ID="lblRowsPerPage" runat="server" Text="Rows Per Page" />
                        </td>
                        <td style="padding-right: 10px !important;">
                            <asp:TextBox ID="txtRowsPerPage" runat="server" Text="10" onkeypress="return isNumberKey(event)" Style="width: 40px !important; text-align: center;" onkeydown=" return OnTextChanged(this);" />
                        </td>
                        <td>
                            <asp:Button ID="btnPrev" runat="server" Text="Prev" CssClass="btn" Style="width: 50px" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtPageNumber" runat="server" Text="1" Style="width: 40px !important; text-align: center;" onkeypress="return isNumberKey(event)" AutoPostBack="true" OnTextChanged="txtPageNumber_TextChanged" />
                        </td>
                        <td style="padding-right: 10px !important;">
                            <asp:Button ID="btnNext" runat="server" Text="Next" CssClass="btn" Style="width: 50px" />
                        </td>

                        <td>
                            <asp:LinkButton ID="lnkBtnMoreFilters" runat="server" CssClass="linkButtonColour" Text="More Filters"></asp:LinkButton>
                        </td>

                        <td style="padding-right: 5px !important;">
                            <asp:LinkButton ID="lnkBtnClearFilters" runat="server" CssClass="linkButtonColour" Visible="false" Text="Clear Filters"></asp:LinkButton>
                        </td>
                        <td>
                            <asp:Button ID="btnTest" runat="server" Text="Open PopUp" Visible="false" CssClass="btn" Style="width: 80px" />
                        </td>
                        <td>
                            <asp:Button ID="btnShowPanel" runat="server" Style="display: none" Text="Show Panel" />
                        </td>

                    </tr>
                </table>

                <table>
                    <tr>
                        <td></td>
                    </tr>
                </table>

                <table>
                    <tr>
                        <td></td>
                    </tr>
                </table>

                <asp:GridView ID="grdData" ShowHeaderWhenEmpty="false" EmptyDataText="No Records Found" BorderWidth="1"
                    rules="All" ShowHeader="true" runat="server" AllowSorting="true" PagerStyle-Height="32px"
                    AutoGenerateColumns="false"
                    CssClass="Grid" SelectedRowStyle-Wrap="true">
                    <%--<SelectedRowStyle CssClass="GridItemSelect wid"  />--%>
                    <RowStyle CssClass="GridItem" />
                    <HeaderStyle CssClass="GridHeader" />
                    <FooterStyle CssClass="GridFooter" />
                    <PagerStyle CssClass="GridPager" />
                    <EditRowStyle CssClass="GridItemSelect" />

                    <%-- <FooterStyle Height ="42px" />--%>

                    <RowStyle CssClass="GridItem" Wrap="true" />

                    <%--<SelectedRowStyle CssClass="GridItemSelect"></SelectedRowStyleOnCheckedChanged="Checkchanged" >--%>
                    <EmptyDataTemplate>
                        <asp:Label ID="lblqueuedatagrid" runat="server" Text="No data found."></asp:Label>
                    </EmptyDataTemplate>
                    <Columns>

                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:CheckBox type="checkbox" runat="server" ID="chkGrid" AutoPostBack="true" Enabled="true" />
                            </ItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField>
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                            <EditItemTemplate>
                                <asp:LinkButton ID="btnUpdate" runat="server" CommandName="Update" Text="Save " ValidationGroup="Update" Width="33px" CssClass="display: inline-block;" />

                                <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Cancel" Text="Cancel" Width="33px" CssClass="display: inline-block;" />
                            </EditItemTemplate>

                            <ItemTemplate>
                                <asp:LinkButton ID="btnEdit" runat="server" CommandName="Edit" Width="80px" Text="Edit" ValidationGroup="Edit" />
                            </ItemTemplate>
                            <FooterTemplate>
                                <%--<asp:LinkButton ID="btnInsert" runat="server" CommandName="Add" Text="Add" Width="90"   ValidationGroup="Insert"/>--%>
                            </FooterTemplate>

                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Layout Code" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Left" ItemStyle-VerticalAlign="Middle" HeaderStyle-CssClass="width1" ControlStyle-CssClass="width1" ItemStyle-CssClass="width1" SortExpression="Rfmd_layout_code">
                            <ItemTemplate>
                                <asp:Label ID="lblLayoutCode" runat="server" Text='<%# Eval("Rfmd_layout_code")%>' ToolTip='<%# Eval("Rfmd_layout_code")%>'></asp:Label>
                            </ItemTemplate>

                            <EditItemTemplate>
                                <asp:DropDownList ID="ddlLayoutCode" CssClass="ddl" runat="server"></asp:DropDownList>
                                <%--<asp:TextBox ID="txtLayoutCode" Text='<%# Eval("Rfmd_layout_code")%>' runat="server"></asp:TextBox>--%>
                            </EditItemTemplate>

                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Template" SortExpression="RFMD_TemplateId" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Right" Visible="false" ItemStyle-VerticalAlign="Middle">
                            <ItemTemplate>
                                <asp:Label ID="lblTemplateId" runat="server" Width="90px" Text='<%# Eval("RFMD_TemplateId")%>' ToolTip='<%# Eval("RFMD_TemplateId")%>'></asp:Label>
                            </ItemTemplate>

                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Template Name" SortExpression="Template_Name" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="left" ItemStyle-VerticalAlign="Middle">
                            <ItemTemplate>
                                <asp:Label ID="lblTemplateName" runat="server" Width="130px" Text='<%# Eval("Template_Name")%>' ToolTip='<%# Eval("Template_Name")%>'></asp:Label>
                            </ItemTemplate>

                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="User Group" SortExpression="RFMD_UserGroup" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Left" ControlStyle-Width="130px" Visible="false">
                            <ItemTemplate>
                                <div style="word-wrap: break-word;">
                                    <asp:Label ID="lblUsrGrp" runat="server" Width="130px" Text='<%# Eval("RFMD_UserGroup")%>'> <%-- lblUsrGrp--%>
                                    </asp:Label>
                                </div>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtUsrGrp" runat="server" Width="130px" Text='<%# Eval("RFMD_UserGroup")%>'> <%--  txtUsrGrp--%>
                                </asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Row" SortExpression="YrightVal" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Right">

                            <ItemTemplate>
                                <asp:Label ID="lblYCoordinate" runat="server" Text='<%# Eval("YrightVal")%>' Visible="true" Width="40px" ToolTip='<%# Eval("YrightVal")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:DropDownList ID="f_drd_lblYCoordinate" runat="server" AutoPostBack="true" CssClass="ddl" Width="50px"></asp:DropDownList>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Col" SortExpression="XleftVal" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Right">
                            <ItemTemplate>
                                <asp:Label ID="lblXCoordinate" runat="server" Text='<%# Eval("XleftVal")%>' Visible="true" Width="40px" ToolTip='<%# Eval("XleftVal")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:DropDownList ID="f_drd_lblXCoordinate" runat="server" AutoPostBack="true" CssClass="ddl" Width="50px"></asp:DropDownList>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Remark" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Left" ControlStyle-Width="100px" SortExpression="RFMD_Remarks">
                            <ItemTemplate>
                                <div style="word-wrap: break-word;">
                                    <asp:Label ID="lblRemarks" runat="server" Text='<%# Eval("RFMD_Remarks")%>' Visible="true" Width="100px" ToolTip='<%# Eval("RFMD_Remarks")%>'></asp:Label>
                                </div>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtRemarks" runat="server" Width="100px" Text='<%# Eval("RFMD_Remarks")%>' Visible="true"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Display Name" SortExpression="RFMD_Field_Display_Name" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Center" ControlStyle-Width="120px">
                            <ItemTemplate>
                                <div style="word-wrap: break-word;">
                                    <asp:Label ID="lblRFMD_Field_Display_Name" runat="server" Width="150px" Text='<%# Eval("RFMD_Field_Display_Name")%>' Visible="true"></asp:Label>
                                </div>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtbxRFMD_Field_Display_Name" runat="server" Width="150px" Text='<%# Eval("RFMD_Field_Display_Name")%>' Visible="true"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>


                        <asp:TemplateField HeaderText="Visible Y/N" SortExpression="RFMD_Field_Visible_YN" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:Label ID="lblRFMD_Field_Visible_YN" runat="server" Text='<%# Eval("RFMD_Field_Visible_YN")%>' Visible="true" Width="40px" ToolTip='<%# Eval("RFMD_Field_Visible_YN")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:DropDownList ID="f_drd_RFMD_Field_Visible_YN" runat="server" AutoPostBack="true" CssClass="ddl" Width="50px">
                                    <asp:ListItem Value="N">N</asp:ListItem>
                                    <asp:ListItem Value="Y">Y</asp:ListItem>
                                </asp:DropDownList>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Clickable Y/N" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Center" SortExpression="RFMD_Clickable_YN">
                            <ItemTemplate>
                                <asp:Label ID="lblClickableYN" runat="server" Visible="true" Width="40px" Text='<%# Eval("RFMD_Clickable_YN")%>' ToolTip='<%# Eval("RFMD_Clickable_YN")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:DropDownList ID="ddlClickableYN" runat="server" AutoPostBack="true" CssClass="ddl" Width="50px">
                                    <asp:ListItem Value="N">N</asp:ListItem>
                                    <asp:ListItem Value="Y">Y</asp:ListItem>
                                </asp:DropDownList>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Bracket for Label Y/N" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Center" SortExpression="RFMD_RoundBracketForLabel_YN">
                            <ItemTemplate>
                                <asp:Label ID="lblRFMD_RoundBracketForLabel_YN" runat="server" Text='<%# Eval("RFMD_RoundBracketForLabel_YN")%>' Visible="true" Width="40px" ToolTip='<%# Eval("RFMD_RoundBracketForLabel_YN")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:DropDownList ID="f_drd_RFMD_RoundBracketForLabel_YN" runat="server" AutoPostBack="true" CssClass="ddl" Width="50px">
                                    <asp:ListItem Value="N">N</asp:ListItem>
                                    <asp:ListItem Value="Y">Y</asp:ListItem>
                                </asp:DropDownList>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Bold No Before Decimal Y/N" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Center" SortExpression="RFMD_BoldNumberBeforeDecimal_YN">
                            <ItemTemplate>
                                <asp:Label ID="lblBoldNoBeforeDecYN" runat="server" Text='<%# Eval("RFMD_BoldNumberBeforeDecimal_YN")%>' Visible="true" Width="40px" ToolTip='<%# Eval("RFMD_BoldNumberBeforeDecimal_YN")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:DropDownList ID="ddlBoldNumberBeforeDec" runat="server" AutoPostBack="true" CssClass="ddl" Width="50px">
                                    <asp:ListItem Value="N">N</asp:ListItem>
                                    <asp:ListItem Value="Y">Y</asp:ListItem>
                                </asp:DropDownList>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="Merge Cell Y/N" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Center" SortExpression="RFMD_MergeCellYN">
                            <ItemTemplate>
                                <asp:Label ID="lblMergeCellYN" runat="server" Text='<%# Eval("RFMD_MergeCellYN")%>' Width="40px" ToolTip='<%# Eval("RFMD_MergeCellYN")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:DropDownList ID="ddlMergeCellYN" runat="server" CssClass="ddl" Width="50px">
                                    <asp:ListItem Value="N">N</asp:ListItem>
                                    <asp:ListItem Value="Y">Y</asp:ListItem>
                                </asp:DropDownList>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Number Format" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Center" SortExpression="RFMD_NumberFormat">
                            <ItemTemplate>
                                <asp:Label ID="lblNumFormat" runat="server" Text='<%# Eval("RFMD_NumberFormat")%>' Visible="true" Width="60px"></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:DropDownList ID="ddlNumFormat" runat="server" AutoPostBack="true" CssClass="ddl" Width="50px">
                                    <asp:ListItem Value=""></asp:ListItem>
                                    <asp:ListItem Value="1">1</asp:ListItem>
                                    <asp:ListItem Value="2">2</asp:ListItem>
                                    <asp:ListItem Value="3">3</asp:ListItem>
                                    <asp:ListItem Value="4">4</asp:ListItem>
                                    <asp:ListItem Value="5">5</asp:ListItem>
                                    <asp:ListItem Value="6">6</asp:ListItem>
                                    <asp:ListItem Value="7">7</asp:ListItem>
                                    <asp:ListItem Value="8">8</asp:ListItem>
                                    <asp:ListItem Value="9">9</asp:ListItem>
                                    <asp:ListItem Value="10">10</asp:ListItem>
                                </asp:DropDownList>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Data Type" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Left" SortExpression="RFMD_Field_Type">
                            <ItemTemplate>
                                <asp:Label ID="lblFieldType" runat="server" Text='<%# Eval("RFMD_Field_Type")%>' Visible="true" Width="70px" ToolTip='<%# Eval("RFMD_Field_Type")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:DropDownList ID="f_drd_FieldType" runat="server" AutoPostBack="true" CssClass="ddl" OnSelectedIndexChanged="f_drd_FieldType_SelectedIndexChanged" Width="90px"></asp:DropDownList>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Sub Data Type" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Left" ControlStyle-Width="80px" SortExpression="RFMD_Field_DataType">
                            <ItemTemplate>
                                <asp:Label ID="lblFieldDataType" runat="server" Text='<%# Eval("RFMD_Field_DataType")%>' Visible="true" Width="80px" ToolTip='<%# Eval("RFMD_Field_DataType")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:DropDownList ID="f_drd_FieldDataType" runat="server" AutoPostBack="true" CssClass="ddl" Width="80px"></asp:DropDownList>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Source Field/Function" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Left" SortExpression="RFMD_TargetField">
                            <ItemTemplate>
                                <div style="word-wrap: break-word;">
                                    <asp:Label ID="lblRFMD_TargetField" runat="server" Text='<%# Eval("RFMD_TargetField")%>' Visible="true" Width="140px" ToolTip='<%# Eval("RFMD_TargetField")%>'></asp:Label>
                                    <div>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <ucRMWMetadata:RMWMetadata_TargetField_SmartSearch runat="server" ID="RMWMetadata_TargetField_SmartSearch1" />
                            </EditItemTemplate>


                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Source Field/Function OnClick" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Left" SortExpression="RFMD_TargetField_Clickable">
                            <ItemTemplate>
                                <asp:Label ID="lbltargetFunctionClikable" runat="server" Visible="true" Width="140px" Text='<%# Eval("RFMD_TargetField_Clickable")%>' ToolTip='<%# Eval("RFMD_TargetField_Clickable")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txttargetFunctionClikable" runat="server" Width="140px" Text='<%# Eval("RFMD_TargetField_Clickable")%>' Visible="true"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Alias" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Left" ControlStyle-Width="80px" SortExpression="RFMD_TextAfterData"><%--Text After Data--%>
                            <ItemTemplate>
                                <asp:Label ID="lblTextAfterData" runat="server" Text='<%# Eval("RFMD_TextAfterData")%>' Visible="true" Width="80px" ToolTip='<%# Eval("RFMD_TextAfterData")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtTextAfterData" runat="server" Width="80px" Text='<%# Eval("RFMD_TextAfterData")%>' Visible="true"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>



                        <asp:TemplateField HeaderText="CSS Style" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Left" SortExpression="RFMD_CSS_Style">
                            <ItemTemplate>
                                <div style="word-wrap: break-word;">
                                    <asp:Label ID="lblRFMD_CSS_Style" runat="server" Text='<%# Eval("RFMD_CSS_Style")%>' Visible="true" Width="190px" ToolTip='<%# Eval("RFMD_CSS_Style")%>'></asp:Label>
                                </div>
                            </ItemTemplate>

                        </asp:TemplateField>


                        <asp:TemplateField HeaderText="Image Source" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Left" SortExpression="RFMD_Image_Path">
                            <ItemTemplate>
                                <asp:Label ID="lblRFMD_Image_Path" runat="server" Text='<%# Eval("RFMD_Image_Path")%>' Visible="true" Width="150px" Style="word-wrap: normal; word-break: break-all;" ToolTip='<%# Eval("RFMD_Image_Path")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtRFMD_Image_Path" runat="server" Width="150px" Text='<%# Eval("RFMD_Image_Path")%>' Visible="true"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Image Ext" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="60px" SortExpression="RFMD_Image_Extension">
                            <ItemTemplate>
                                <asp:Label ID="lblRFMD_Image_Extension" runat="server" Text='<%# Eval("RFMD_Image_Extension")%>' Visible="true" Width="60px" ToolTip='<%# Eval("RFMD_Image_Extension")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:DropDownList ID="ddlImageExtension" runat="server" AutoPostBack="true" CssClass="ddl" Width="60px">
                                    <asp:ListItem></asp:ListItem>
                                    <asp:ListItem>PNG</asp:ListItem>
                                    <asp:ListItem>JPG</asp:ListItem>
                                </asp:DropDownList>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Image Target Field" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Center" SortExpression="RFMD_Image_Data_Field">
                            <ItemTemplate>
                                <div style="word-wrap: break-word;">
                                    <asp:Label ID="lblRFMD_Image_Data_Field" runat="server" Text='<%# Eval("RFMD_Image_Data_Field")%>' Visible="true" Width="120px" ToolTip='<%# Eval("RFMD_Image_Data_Field")%>'></asp:Label>
                                </div>
                            </ItemTemplate>


                            <EditItemTemplate>
                                <asp:TextBox ID="txtRFMD_Image_Data_Field" runat="server" Width="120px" Text='<%# Eval("RFMD_Image_Data_Field")%>' Visible="true"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Video Source" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="150px" SortExpression="RFMD_VideoSource">
                            <ItemTemplate>
                                <div style="word-wrap: break-word;">
                                    <asp:Label ID="lblVideoSource" runat="server" CssClass="BreakWord" Text='<%#Eval("RFMD_VideoSource") %>' ToolTip='<%#Eval("RFMD_VideoSource")%>'></asp:Label>
                                </div>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:LinkButton ID="btnEditVideo" runat="server" CommandName="EditVideo" Width="80px" Text="Upload Video" ValidationGroup="Edit" />
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Updated At" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="160px" Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="lblRFMD_UpdatedAt" runat="server" Text='<%# Eval("RFMD_UpdatedAt")%>' Width="160px" Visible="true"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Updated By" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Left" ControlStyle-Width="70px" HeaderStyle-HorizontalAlign="Center" Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="lblRFMD_UpdatedBy" runat="server" Text='<%# Eval("RFMD_UpdatedBy")%>' Width="70px" Visible="true"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Formatting Link" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Left" ControlStyle-Width="100px" Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="lblRFMD_Sourcing_Link" runat="server" Text='<%# Eval("RFMD_Sourcing_Link")%>' Visible="true" Width="150px" ToolTip='<%# Eval("RFMD_Sourcing_Link")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtbxRFMD_Sourcing_Link" runat="server" Width="80px" Text='<%# Eval("RFMD_Sourcing_Link")%>' Visible="true"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Fore Color" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Left" ControlStyle-Width="80px" Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="lblRFMD_ForeColor" runat="server" Text='<%# Eval("RFMD_ForeColor")%>' Visible="true" Width="120px" ToolTip='<%# Eval("RFMD_ForeColor")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:Label ID="hdnlblforeColour" runat="server" Visible="false" Text='<%# Eval("RFMD_BackColor")%>' />
                                <asp:TextBox ID="txtforeColour" runat="server" CssClass="txt" AutoPostBack="true"></asp:TextBox>
                                <cc1:ColorPickerExtender
                                    ID="txtCardColor_ColorPickerExtender"
                                    TargetControlID="txtforeColour"
                                    Enabled="True"
                                    runat="server"></cc1:ColorPickerExtender>
                            </EditItemTemplate>
                        </asp:TemplateField>


                        <asp:TemplateField HeaderText="Back Color" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Left" ControlStyle-Width="80px" Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="lblRFMD_BackColor" runat="server" Text='<%# Eval("RFMD_BackColor")%>' Visible="true" Width="120px" ToolTip='<%# Eval("RFMD_BackColor")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:Label ID="hdnlblColour" runat="server" Visible="false" Text='<%# Eval("RFMD_BackColor")%>' />
                                <asp:TextBox ID="txtColour" runat="server" CssClass="txt" AutoPostBack="true"></asp:TextBox>
                                <cc1:ColorPickerExtender
                                    ID="txtCardColor_ColorPickerExtenderB"
                                    TargetControlID="txtColour"
                                    Enabled="True"
                                    runat="server"></cc1:ColorPickerExtender>
                            </EditItemTemplate>
                        </asp:TemplateField>


                        <asp:TemplateField HeaderText="Font Weight" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Center" ControlStyle-Width="80px" Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="lblRFMD_FontWeight" runat="server" Width="80px" Text='<%# Eval("RFMD_FontWeight")%>' Visible="true"></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtbxRFMD_FontWeight" runat="server" Width="80px" Text='<%# Eval("RFMD_FontWeight")%>' Visible="true"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Font Size" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Center" ControlStyle-Width="80px" Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="lblRFMD_FontSize" runat="server" Width="80px" Text='<%# Eval("RFMD_FontSize")%>' Visible="true"></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtbxRFMD_FontSize" runat="server" Width="80px" Text='<%# Eval("RFMD_FontSize")%>' Visible="true"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Font Name" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Left" ControlStyle-Width="80px" Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="lblRFMD_FontName" runat="server" Text='<%# Eval("RFMD_FontName")%>' Visible="true" Width="150px" ToolTip='<%# Eval("RFMD_FontName")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtbxRFMD_FontName" runat="server" Width="80px" Text='<%# Eval("RFMD_FontName")%>' Visible="true"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="ID" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="lblFieldId" runat="server" Width="40px" Text='<%# Eval("RFMD_Field_Id")%>' ToolTip='<%# Eval("RFMD_Field_Id")%>'></asp:Label>
                            </ItemTemplate>

                        </asp:TemplateField>

                    </Columns>
                    <SelectedRowStyle Wrap="False" />
                </asp:GridView>

            </div>

            <asp:HiddenField ID="hdnUpdateFlg" runat="server" />
            <asp:HiddenField ID="hdnSortOrder" runat="server" />
            <asp:HiddenField ID="HdnSearchString" runat="server" />
            <asp:Button ID="hdnApplyFilterResult" runat="server" Style="visibility: hidden; display: none" />
            <asp:HiddenField runat="server" ID="rowIndex" Value="" />
            <asp:HiddenField runat="server" ID="hdnTop" Value="" />
            <asp:HiddenField runat="server" ID="hdnLeft" Value="" />
            <asp:HiddenField runat="server" ID="hdnVideoFileName" Value="" />
            <asp:HiddenField runat="server" ID="hdnSelectedLayoutCodes" Value="" />
            <asp:HiddenField runat="server" ID="hdnTemplateID" Value="" />

        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="btnSave" />
            <asp:PostBackTrigger ControlID="btnExport" />
            <asp:PostBackTrigger ControlID="btnUploadVideo" />
        </Triggers>
    </asp:UpdatePanel>

    <asp:Panel ID="grpUsergroup" runat="server" CssClass="invisible">
        <table>
            <tr>
                <td>
                    <table class="InnerTable">
                        <tr>
                            <td>
                                <asp:TextBox ID="txtUsername" CssClass="txt txtUsername" runat="server" Text=""></asp:TextBox>
                            </td>
                            <td>
                                <asp:Button ID="btnLoadGrp" CssClass="btn btnGroupbox" runat="server" Text="Load" />
                            </td>
                            <td>
                                <asp:Button ID="btnSaveGrp" CssClass="btn btnGroupbox" runat="server" Text="Save" />
                            </td>
                            <td>
                                <asp:Button ID="btnCloseGrp" runat="server" Text="X" CssClass="btn btnClose" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="GridContainerTD">
                        <asp:GridView ID="dgvUser" runat="server" AllowSorting="True"
                            AutoGenerateColumns="false" BorderStyle="Solid" BorderWidth="1px" CellPadding="3"
                            CssClass="Grid" Width="361px">
                            <HeaderStyle CssClass="GridHeader" />

                            <Columns>
                                <asp:TemplateField HeaderStyle-Wrap="true" HeaderText=" ">
                                    <HeaderStyle Wrap="True" Width="25px" HorizontalAlign="Center" />
                                    <HeaderTemplate>
                                        <asp:CheckBox ID="chkAll" runat="server" onclick="checkAll(this);" />
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chkbox_UserQGrp" runat="server"></asp:CheckBox>
                                    </ItemTemplate>
                                    <HeaderStyle Wrap="true" HorizontalAlign="Center" VerticalAlign="Middle" />
                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="false" />
                                </asp:TemplateField>


                                <asp:TemplateField HeaderText="User ID">
                                    <HeaderStyle></HeaderStyle>
                                    <ItemStyle></ItemStyle>
                                    <ItemTemplate>
                                        <asp:Label ID="lblusrId" CssClass="lbl" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.U_ID").ToString)%>' />
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="User Name">
                                    <HeaderStyle></HeaderStyle>
                                    <ItemStyle></ItemStyle>
                                    <ItemTemplate>
                                        <asp:Label ID="lblusr" CssClass="lbl" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Name").ToString)%>' />
                                    </ItemTemplate>
                                </asp:TemplateField>

                            </Columns>
                        </asp:GridView>
                    </div>
                </td>
            </tr>
        </table>
    </asp:Panel>

    <asp:UpdatePanel ID="updatePanelVideo" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pnlVideo" runat="server" CssClass="invisible groupBoxVideoUpload">
                <div id="divVideouploadMain" runat="server" class="divVideoUploadMain">
                    <table>
                        <tr>
                            <td>
                                <asp:FileUpload ID="FileUploadRMWM" runat="server" AutoPostBack="True" Height="28px" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Button ID="btnUploadVideo" runat="server" CssClass="btn" Text="Upload" />
                                &nbsp;
                            <asp:Button ID="btnCloseVideoPopUp" runat="server" CssClass="btn" Text="Close" />
                            </td>
                        </tr>
                    </table>
                </div>
                <div id="overlayDiv" class="overlaySearch"></div>

            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>

    <%--Added by Shubham Podhade/Nikhil Mali for CSS Panel - START--%>
    <asp:UpdatePanel ID="updt_pnlCssStyle" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pnlCssStyle" runat="server" CssClass="invisible groupBoxCSSPanel">
                <div id="divCssStyle" runat="server" class="divVideoUploadMain beautifyPopUpCssStyle">
                    <table>
                        <tr>
                            <td>
                                <table>
                                    <tr>
                                        <td>
                                            <table>

                                                <%-- <tr>
                                                    <td style="padding-bottom: 5px;">
                                                        <asp:Label ID="lblInfoTemplateNameStat" runat="server" Text="Editing:" />
                                                        <asp:Label ID="lblInfoTemplateName" runat="server" Text="Test" /> &nbsp;
                                                        <asp:Label ID="lblRowEditingInfo" runat="server" Text="  Row:" />
                                                        <asp:Label ID="lblRowEditing" runat="server" Text="0" />&nbsp;
                                                        <asp:Label ID="lblColEditingInfo" runat="server" Text="  Col:" />
                                                        <asp:Label ID="lblColEditing" runat="server" Text="1" />

                                                    </td>
                                                </tr>--%>


                                                <tr>
                                                    <td style="padding-bottom: 8px">
                                                        <asp:Button ID="btnSaveCssStyle" runat="server" Text="Apply" CssClass="btn btnGroupBox" />
                                                    </td>
                                                    <td style="padding-left: 240px; padding-bottom: 8px">
                                                        <asp:Button ID="btnCancelCssStyle" runat="server" Text="X" CssClass="btn btnClose" />
                                                    </td>

                                                </tr>
                                            </table>
                                            <table>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblPageHeight" Text="Height :" runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtPageHeight" runat="server" CssClass="changeSizeTextBox" Text="0" onkeypress="return isNumberKey(event)"></asp:TextBox>
                                                        <input type="button" class="btn btnSize" value="+" onclick="changeSize(this);" />
                                                        <input type="button" class="btn btnSize" value="-" onclick="changeSize(this);" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblFontWeigth" Text="Font-weight :" runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtFontWeigth" Text="" runat="server"> </asp:TextBox>
                                                    </td>

                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblPageFontSize" Text="Font-Size :" runat="server"></asp:Label>
                                                    </td>
                                                    <td>

                                                        <asp:TextBox ID="txtPageFontSize" runat="server" CssClass="changeSizeTextBox" Text="0" onkeypress="return isNumberKey(event)"></asp:TextBox>
                                                        <input type="button" class="btn btnSize" value="+" onclick="changeSize(this);" />
                                                        <input type="button" class="btn btnSize" value="-" onclick="changeSize(this);" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblFontcolor" Text="Color :" runat="server"></asp:Label>

                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtFontColor" runat="server" />
                                                        <cc1:ColorPickerExtender ID="ColorPickerExtender2" TargetControlID="txtFontColor" Enabled="True" runat="server"></cc1:ColorPickerExtender>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblWidth" Text="Width :" runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtWidth" Text="0" runat="server" CssClass="changeSizeTextBox" onkeypress="return isNumberKey(event)"></asp:TextBox>
                                                        <input type="button" class="btn btnSize" value="+" onclick="changeSize(this);" />
                                                        <input type="button" class="btn btnSize" value="-" onclick="changeSize(this);" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblVerticalAlign" Text="Vertical-align :" runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtVerticalAlign" Text="" runat="server"></asp:TextBox>
                                                    </td>

                                                </tr>

                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblPaddingLeft" Text="Padding-Left :" runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtPaddingLeft" Text="0" runat="server" CssClass="changeSizeTextBox" onkeypress="return isNumberKey(event)"></asp:TextBox>
                                                        <input type="button" class="btn btnSize" value="+" onclick="changeSize(this);" />
                                                        <input type="button" class="btn btnSize" value="-" onclick="changeSize(this);" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblPaddingRight" Text="Padding-Right :" runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtPaddingRight" Text="0" runat="server" CssClass="changeSizeTextBox" onkeypress="return isNumberKey(event)"></asp:TextBox>
                                                        <input type="button" class="btn btnSize" value="+" onclick="changeSize(this);" />
                                                        <input type="button" class="btn btnSize" value="-" onclick="changeSize(this);" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblPaddingTop" Text="Padding-Top :" runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtPaddingTop" Text="0" runat="server" CssClass="changeSizeTextBox" onkeypress="return isNumberKey(event)"></asp:TextBox>
                                                        <input type="button" class="btn btnSize" value="+" onclick="changeSize(this);" />
                                                        <input type="button" class="btn btnSize" value="-" onclick="changeSize(this);" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblPaddingBottom" Text="Padding-Bottom :" runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtPaddingBottom" Text="0" runat="server" CssClass="changeSizeTextBox" onkeypress="return isNumberKey(event)"></asp:TextBox>
                                                        <input type="button" class="btn btnSize" value="+" onclick="changeSize(this);" />
                                                        <input type="button" class="btn btnSize" value="-" onclick="changeSize(this);" />
                                                    </td>
                                                </tr>



                                            </table>
                                        </td>
                                    </tr>
                                </table>

                                <table>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblOther" Text="Other :" runat="server"></asp:Label>
                                        </td>

                                        <td>
                                            <table>
                                                <tr>
                                                    <td>
                                                        <asp:TextBox ID="txtOther" Text="" runat="server" TextMode="MultiLine" Height="85px" Width="190px" Style="margin: 0px 0px 0px 57px;"></asp:TextBox>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>

                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </div>
                <div id="overlayDivCssStyle" class="overlaySearch"></div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--Added by Shubham Podhade/Nikhil Mali for CSS Panel - END--%>

    <asp:UpdatePanel ID="updpnlMoreFilter" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pnlMoreFilters" runat="server" CssClass="invisible groupBoxMoreFilterPanel">
                <div id="divPnlMoreFiltersMain" runat="server" class="divVideoUploadMain beautifyPopUpCssStyle">
                    <table style="width: 100%">
                        <tr>
                            <td>

                                <table>
                                    <tr>


                                        <td style="width: 120px; text-align: center; padding-bottom: 10px;">
                                            <asp:Button runat="server" ID="btnRefresh" Text="Refresh" CssClass="btn" Width="100px" />
                                        </td>

                                        <td style="width: 120px; text-align: center; padding-bottom: 10px;">
                                            <asp:Button runat="server" ID="btnApply" Text="Apply" CssClass="btn" Width="100px" />
                                        </td>

                                        <td style="padding-left: 390px; padding-bottom: 10px;">
                                            <asp:Button runat="server" ID="btnClose" Text="X" CssClass="btn btnClose" />
                                        </td>


                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <%--<fieldset>--%>
                                <legend style="font-weight: bold; height: 24px;">Filters</legend>
                                <asp:GridView ID="grdFilter" ShowHeaderWhenEmpty="true" EmptyDataText="No Records Found" BorderWidth="1" rules="all"
                                    ShowHeader="true" runat="server" PagerStyle-Height="32px" HeaderStyle-CssClass="GridHeaderTitle"
                                    AutoGenerateColumns="false" CssClass="Grid" CellPadding="0"
                                    SelectedRowStyle-Wrap="true">

                                    <SelectedRowStyle CssClass="wid" Wrap="false" BackColor="#F0F0F0" />

                                    <RowStyle BorderStyle="None" CssClass="GridItem1" />
                                    <HeaderStyle HorizontalAlign="Center" />

                                    <Columns>
                                        <asp:TemplateField HeaderText="" HeaderStyle-Width="30px" HeaderStyle-Font-Bold="false" HeaderStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:CheckBox runat="server" Enabled="true" ID="chkSingle" BorderStyle="None"></asp:CheckBox>
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                        <asp:TemplateField HeaderText="Filter By" HeaderStyle-Font-Bold="false" HeaderStyle-HorizontalAlign="Center">
                                            <HeaderStyle HorizontalAlign="Center" Width="180px" />
                                            <ItemStyle HorizontalAlign="Left" Width="180px" />
                                            <ItemTemplate>
                                                <asp:Label runat="server" Enabled="true" Width="180px" ID="lblFilterName" Text='<%# DataBinder.Eval(Container, "DataItem.RMWM_ColumnHeader")%>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                        <asp:TemplateField HeaderText="Filter By DB Name" HeaderStyle-Font-Bold="false" Visible="false" HeaderStyle-HorizontalAlign="Center">
                                            <HeaderStyle HorizontalAlign="Center" Width="180px" />
                                            <ItemStyle HorizontalAlign="Left" Width="180px" />
                                            <ItemTemplate>
                                                <asp:Label runat="server" Enabled="true" Width="180px" ID="lblFilterDBName" Text='<%# DataBinder.Eval(Container, "DataItem.RMWM_DBColumnHeader")%>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                        <asp:TemplateField HeaderText="Comparator" HeaderStyle-Font-Bold="false" HeaderStyle-HorizontalAlign="Center" ControlStyle-BorderStyle="None">
                                            <HeaderStyle HorizontalAlign="Center" Width="180px" />
                                            <ItemStyle HorizontalAlign="Left" Width="180px" />
                                            <ItemTemplate>
                                                <asp:DropDownList runat="server" Enabled="true" ID="ddlFilterComparator" Width="180px" CssClass="ddl">
                                                    <asp:ListItem></asp:ListItem>
                                                    <asp:ListItem>=</asp:ListItem>
                                                    <asp:ListItem>like</asp:ListItem>
                                                </asp:DropDownList>
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                        <asp:TemplateField HeaderText="Value" HeaderStyle-Font-Bold="false" HeaderStyle-HorizontalAlign="Center">
                                            <HeaderStyle HorizontalAlign="Center" Width="180px" />
                                            <ItemStyle HorizontalAlign="Left" Width="180px" />
                                            <ItemTemplate>
                                                <asp:TextBox runat="server" Enabled="true" AutoPostBack="true" ID="txtFilterValue" Width="180px" BorderStyle="None"></asp:TextBox>
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                        <asp:TemplateField HeaderText="Data Type" HeaderStyle-Width="200px" HeaderStyle-Font-Bold="false" HeaderStyle-HorizontalAlign="Center" Visible="false">
                                            <ItemTemplate>
                                                <asp:Label runat="server" Enabled="true" ID="lblColumnDataType" Text=''></asp:Label>
                                                <%--Text='<%# DataBinder.Eval(Container, "DataItem.WBM_Column_Data_Type")%>'--%>
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                        <asp:TemplateField HeaderText="Sort" HeaderStyle-Font-Bold="false" HeaderStyle-HorizontalAlign="Center" Visible="false">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtSort" runat="server" Width="20px" AutoPostBack="true" onkeypress="return isNumber(event)"></asp:TextBox>
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                        <asp:TemplateField HeaderText="Desc" HeaderStyle-Font-Bold="false" HeaderStyle-HorizontalAlign="Center" Visible="false">
                                            <ItemTemplate>
                                                <asp:CheckBox runat="server" ID="chkDesc" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                                <%--</fieldset>--%>
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                        </tr>


                        <tr>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                        </tr>

                        <tr>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                        </tr>

                        <tr>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                        </tr>
                    </table>
                </div>
                <div id="overlayDivMoreFilters" class="overlaySearch"></div>

            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pnlPreview" runat="server" CssClass="invisible">
                <div id="divPreview" style="display: none; position: absolute !important; top: 192px; left: 20px; z-index: 10;" class="VideoUploadPopup"></div>
                <div id="overlayPreview" class="overlaySearch1"></div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>

    <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Panel ID="pnlClone" runat="server" CssClass="invisible groupBoxMoreFilterPanel">
                <div id="div1" runat="server" class="divVideoUploadMain beautifyPopUpCssStyle" style="width: fit-content; position: absolute; z-index: 3; width: 430px;">
                    <table style="margin: 10px; padding-bottom: 10px;">

                        <tr>
                            <td style="text-align: left; margin-top: 20px;" colspan="2">
                                <asp:Label ID="lblerrorpop" runat="server" Text=" "></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="text-align: left; padding-top: 10px;">
                                <asp:Label ID="lblCloneUDFNotice" runat="server" Text="Select the target template where the fields are to be copied" CssClass="LBLERROR" Style="text-wrap: normal;"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="text-align: left; padding-top: 10px;">
                                <asp:Label ID="lblTableExistingPop" runat="server" Text=" "></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="lblBlotterPaddingRight">
                                <asp:Label ID="lblTemplateClone" runat="server" CssClass="lbl" Text="Target Template"></asp:Label></td>
                            <td>
                                <asp:DropDownList ID="ddlTemplateClone" Width="285px" runat="server" CssClass="ddl" onchange="return ddlTemplateCloneChanged();"></asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td style="padding-top: 10px; text-align: center;" colspan="2">
                                <asp:Button runat="server" ID="btnConfirmClone" CssClass="btn" Width="140px" Text="Clone Field(s)" OnClientClick="return CloneTemplate();" />
                                <asp:Button runat="server" ID="btnCancelClone" CssClass="btn" Width="140px" Text="Close" OnClientClick="return HideClonePanel();" />
                            </td>
                        </tr>

                    </table>
                </div>
                <div id="divClone" class="overlaySearch1"></div>
            </asp:Panel>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnCopy" />
        </Triggers>
    </asp:UpdatePanel>

</asp:Content>
