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

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"></asp:ScriptManagerProxy>
    <script src="../FinIQJS/SortFilter_Grid.js"></script>
    <script src="../FinIQJS/FreezeGrid.js"></script>
    <link href="../FinIQJS/FreezeGrid.css" type="text/css" rel="stylesheet">
    <style type="text/css">
        .GridContainerTD
        {
            width: 379px;
            height: 255px;
            overflow-y: auto !important;
        }

    .GridItems
    {
        border-color:#dddddd;
        width:250px;
        height:35px;
        text-indent:2px;
    }
    .GridItems th
    {
        font-size: 12px;
        font-weight: normal;
        padding:6px;
        
    }

    .btn
    {
        width:90px;
    }
    .MaincontainerTbl
    {
        border-collapse:collapse;
        margin-top:10px;
    }

    .CommonBtn 
    {
        text-align: center;
        cursor:pointer;
        margin-left : 6px;
        margin-bottom : 6px;
    }
      .BlotterCodeDiv
        {
            float:left;
        }
       
        .lblBlotterCode
        {
            margin-right:4px;
        }

        .txtBoxNum
    {
        text-align:right;
    }

        .GridItem td{
            padding:8px;
        }

          .aspNetDisabled a {
            color:#000000 !important;
        }
            
          .ddlBlotterCode {
            width: 260px !important;
        }
		/*Added By: Tejas V. Bodas on 20/09/2017 to make word wrap*/
        .wrapcol {
            overflow-wrap:break-word;
		}

    </style>
    <asp:UpdatePanel ID ="UpdatePanelCP" runat="server">

        <ContentTemplate>
            <table>
                <tr>
                    <td>
                        <asp:Label ID="lblMsg" CssClass="lbl lblsuccess" runat="server" Visible="True"></asp:Label>
                    </td>
                </tr>
            </table>

            <table>
                <tr>
                    <td>
                        <asp:Panel ID="FilterContainer" runat="server">
                            <div class="BlotterCodeDiv">
                                <asp:Label ID="Label1" CssClass="lbl lblBlotterCode" runat="server" Visible="True" Text="Blotter Code"></asp:Label>
                                <asp:DropDownList ID="ddlBlotter" runat="server" CssClass="ddl ddlBlotterCode" AutoPostBack="true" OnSelectedIndexChanged="ddlBlotter_SelectedIndexChanged" />
                            </div>
                            <asp:Button ID="btnSave" runat="server" Text="Save" CssClass="btn CommonBtn " Style="margin-left:20px;" />
                            <asp:Button ID="btnRefresh" runat="server" Text="Refresh" CssClass="btn CommonBtn" />
                            <asp:label ID="lblBlottercolumn" runat="server" Text="Blotter Column :" Style="padding-left: 5px;" />                                         <%--Added by Nikhil Mali on 29-01-2020--%>
                            <asp:TextBox runat="server" ID="txtBlotterColumn" onkeyup="getenterload()" onkeypress="allowAlphaSpace(event)" />  <%--Added by Nikhil Mali on 29-01-2020--%>
                            <asp:Label ID="lblError" CssClass="lbl lblError" runat="server" Visible="True"></asp:Label>
                            
                            
                        </asp:Panel>
                    </td>
                </tr>

                <tr>
                    <td>
                        <br />

                        <div runat="server" id="InnerDiv">
                            <asp:GridView ID="dgvDetails" runat="server" ShowHeaderWhenEmpty="true"
                                       AutoGenerateColumns="False" CssClass="Grid" BorderStyle="None" BorderWidth="0px" AllowSorting="True"
                                ShowFooter="False" PageSize="20" AllowPaging="False" Width="100%" >
                                <EditRowStyle CssClass="GridItemSelect"/>
                                <RowStyle CssClass="GridItem" />
                                <HeaderStyle CssClass="GridHeader" />
                                <FooterStyle CssClass="GridFooter" />
                                <PagerStyle CssClass="GridPager"/>
                                <EmptyDataTemplate>
                                    <asp:Label ID="lblemptygrid" runat="server" Text="No data found."></asp:Label>
                                </EmptyDataTemplate>
                                <Columns>

                                    <asp:CommandField buttontype="Link" showeditbutton="true" UpdateText="Update" edittext="Edit">
                                        <HeaderStyle Width="80px" HorizontalAlign="Center"/>
                                        <ItemStyle Width="80px" HorizontalAlign="Center"/>
                                    
                                    </asp:CommandField>

                                    <asp:TemplateField HeaderText="Filter Column ID">
                                        <HeaderStyle Wrap="true" Width="40px"></HeaderStyle>
                                        <ItemStyle Wrap="true" Width="40px" HorizontalAlign="Right" CssClass="wrapcol"/>
                                        <ItemTemplate>
                                            <asp:Label ID="lblId" CssClass="lbl txtBoxNum"  runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.MFM_Id")%>' >
                                            </asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Blotter Column">
                                        <HeaderStyle  Wrap="true" Width="250px"></HeaderStyle>
                                        <ItemStyle Wrap="true" Width="250px" HorizontalAlign="left" CssClass="wrapcol"/>
                                        <ItemTemplate>
                                            <asp:Label ID="lblColumnName" CssClass="lbl"  runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.MFM_ColumnName")%>' >
                                            </asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Datasource">
                                        <HeaderStyle Wrap="true" Width="300px"></HeaderStyle>
                                        <ItemStyle Wrap="true" Width="300px" HorizontalAlign="Left" CssClass="wrapcol"/>
                                        <ItemTemplate>
                                            <asp:Label ID="lblDatasource" CssClass="lbl"  runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.MFM_DataSource")%>' >
                                            </asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtDatasource" CssClass="txt" runat="server" width="300px" Text='<%# DataBinder.Eval(Container, "DataItem.MFM_DataSource")%>'></asp:TextBox>
                                        </EditItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Default Comparator">
                                        <HeaderStyle Wrap="true" Width="120px"></HeaderStyle>
                                        <ItemStyle Wrap="true" Width="120px" HorizontalAlign="left" CssClass="wrapcol"/>
                                        <ItemTemplate>
                                            <asp:Label ID="lblDefaultComparator" CssClass="lbl"  runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.MFM_DefaultComparator")%>' >
                                            </asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:Label ID="hdnlblDefaultComparator" CssClass="lbl"  runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.MFM_DefaultComparator")%>' Visible="false" ></asp:Label>
                                            <asp:DropDownList ID="ddlDefaultComparator" CssClass="ddl" runat="server" Width="120px" />
                                        </EditItemTemplate>
                                    </asp:TemplateField>

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

            </table>
       </ContentTemplate>
    </asp:UpdatePanel>

    <script type="text/javascript">

        function getenterload() {                                // Added By Nikhil Mali on 30-1-2020
            if (event.keyCode == 13)// Enter
            {
                document.getElementById('ctl00_MainContent_btnRefresh').click();
            }
        }

        function allowAlphaSpace(e) {                          // Added By Nikhil Mali on 30-1-2020
            var code = ('charCode' in e) ? e.charCode : e.keyCode;
            if (!(code == 32) &&               // space
              !(code == 45) &&                 // '-' symbol
              !(code > 64 && code < 91) &&     // upper alpha (A-Z)
              !(code > 96 && code < 123)) {    // lower alpha (a-z)
                //!(code > 47 && code < 58) && // numeric (0-9)
                e.preventDefault();
            }
        }
		
		 //<START>---Added By Shubham Podhade on 27-Jan-2019 for JS Sorting Searching Filters
        $(document).ready(function () {
            
            SetSorting_Filter1();
        });
        //<END>---Added By Shubham Podhade on 27-Jan-2019 for JS Sorting Searching Filters
    </script>
</asp:Content>