<%@ control language="VB" autoeventwireup="false" inherits="UserControls_SearchPopup, App_Web_searchpopup.ascx.6bb32623" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<script type="text/javascript">
    function ace_itemSelectedItem(sender, e) {

        var senderControl = sender._element.id;

        var hdSelectedText = document.getElementById(senderControl.replace('txtSearch', 'hdSelectedText'));
        var hdSelectedValue = document.getElementById(senderControl.replace('txtSearch', 'hdSelectedValue'));
        var hdSelectedItemValue1 = document.getElementById(senderControl.replace('txtSearch', 'hdSelectedItemValue1'));
        var hdSelectedItemValue2 = document.getElementById(senderControl.replace('txtSearch', 'hdSelectedItemValue2'));

        var selectedItemInfoArray = new Array();
        selectedItemInfoArray = e.get_value().split('_');
        hdSelectedText.value = e._text;

        if (selectedItemInfoArray.length > 0) {
            hdSelectedValue.value = selectedItemInfoArray[0];
            hdSelectedItemValue1.value = selectedItemInfoArray[1];
        }
    }
</script>
<asp:Panel ID="pnlSearchPopup" Visible="true" Height="27px"  ScrollBars="none" 
    runat="server" CssClass="search_popup ">
    <div>
        <div class="layout-row mt6 positionrelative">         
            <asp:TextBox ID="txtSearch" runat="server" CssClass="form-control clsallowextention"   Visible="true" EnableViewState="true"></asp:TextBox>
           <%-- AutoPostBack="true"--%>

                <ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtenderSearchList"   runat="server"
                        TargetControlID="txtSearch" MinimumPrefixLength="1" EnableCaching="false" ShowOnlyCurrentWordInCompletionListItem="true"
                        ServicePath="~/AutoCompleteService.asmx"  CompletionInterval="1000"
                        CompletionListCssClass="autocomplete_completionListElement"
                        CompletionListItemCssClass="autocomplete_listItem"  OnClientItemSelected="ace_itemSelectedItem"
                        CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem">
                 </ajaxToolkit:AutoCompleteExtender>


                      <AjaxToolkit:TextBoxWatermarkExtender ID="wtProject"  runat="server" WatermarkText="Search" TargetControlID="txtSearch"></AjaxToolkit:TextBoxWatermarkExtender>    
                      <asp:HiddenField ID="hdSelectedText" Value="0" runat="server" />
                      <asp:HiddenField ID="hdSelectedValue" Value="0" runat="server" />
                      <asp:HiddenField ID="hdSelectedItemValue1" Value="0" runat="server" />
                      <asp:HiddenField ID="hdSelectedItemValue2" Value="0" runat="server" />
                       

            <asp:ImageButton ID="imgSearch" runat="server" AlternateText="Search" 
                ImageUrl="~/Images/search.png" class="searchbtnabsoluteset" CausesValidation="False" />
               
                 
        </div>
        <div id="divSearch" visible="false" runat="server" class="listView modalPnlWBS">
             <div  class="table-responsive height300"> 
                <asp:GridView ID="gvSearch" runat="server" ShowFooter="false" AllowPaging="true" 
                     PageSize="40"  ShowHeader="false"   
                    GridLines="None" CssClass="table table-bordered table-striped table-hover" AutoGenerateColumns="false" CellPadding="0"
                    CellSpacing="0" EmptyDataText="Data Not Available" 
                     PagerStyle-CssClass="Pagination">
                    <Columns>
                        <asp:TemplateField Visible="false" ItemStyle-CssClass="alignleft" HeaderStyle-HorizontalAlign="Left">
                            <ItemTemplate>
                                <asp:Label ID="lblId" runat="server" Text='<%#Bind("Id")%>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left" />
                            <ItemStyle CssClass="alignleft" />
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-CssClass="alignleft" HeaderStyle-HorizontalAlign="Left">
                            <ItemTemplate>
                                <asp:Button ID="btnGridName" runat="server" Text='<%#Bind("Name")%>' CommandArgument='<%# Bind("Id") %>'
                                    OnClick="btnGridName_Click" BorderStyle="None" BackColor="Transparent" CausesValidation="False"
                                    OnClientClick="this.className='gridbuttonclick'" onMouseOver="this.className='gridbuttonhover1'"
                                    onMouseOut="this.className='dataingrid1'" />
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left" />
                            <ItemStyle CssClass="alignleft" />
                        </asp:TemplateField>
                    </Columns>
                    <PagerSettings PageButtonCount="5" />
                    <PagerStyle CssClass="Pagination" />
                </asp:GridView>
             </div>
            <div class="fr"  >     <asp:LinkButton ID="BtnClose" Visible="false"  runat="server" CssClass="close ">Close</asp:LinkButton>
                <%--<dp2:Pager ID="GridViewPager" Visible="false" ShowPageSizer="false"  PagerViewRange="3" runat="server" />--%>
            </div>
            
            <div class="elemerrormsg" id="lblMessage" runat="server" visible="false">
            </div>
        </div>
      
    
    </div>
   
</asp:Panel>
<asp:HiddenField ID="hdProjNo" runat="server" />
<asp:HiddenField ID="hdTaskType" runat="server" />
