<%@ Control Language="C#" AutoEventWireup="true"
    Inherits="mod_selettore_ajax" Codebehind="mod_selettore_ajax.ascx.cs" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" Visible="true">
    <ContentTemplate>
        <ajaxToolkit:PopupControlExtender ID="pce" runat="server" TargetControlID="txtSelValue"
            PopupControlID="pnlSelettore" Position="Bottom" />
        <ajaxToolkit:PopupControlExtender ID="pce2" runat="server" TargetControlID="lblDescr"
            PopupControlID="pnlSelettore" Position="Bottom" CommitProperty="innerHTML" />
        <div class="selezioneValRed">
            <asp:TextBox ID="txtSelValue" runat="server" Width="0px" CssClass="hiddenTxt"  BorderWidth="0px" TabIndex="-1"/>
            <asp:Label ID="lblDescr" runat="server" Text="-" />
        </div>
    </ContentTemplate>
</asp:UpdatePanel>
<asp:Panel ID="pnlSelettore" runat="server" CssClass="popupControl">
    <asp:UpdatePanel ID="updPnl1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <table cellpadding="0" cellspacing="0" width="50%">
                <tr>
                    <td>
                        <table cellpadding="2" cellspacing="0" width="100%">
                            <tr>
                                <td>
                                    <asp:Label ID="lblCerca" runat="server" />
                                    &nbsp;
                                    <asp:TextBox ID="txtCerca" runat="server" OnTextChanged="txtCerca_TextChanged" AutoPostBack="true" TabIndex="-1"></asp:TextBox>
                                    &nbsp;
                                    <asp:Button ID="btnCerca" runat="server" Text='<%# traduci("lblCerca") %>' OnClick="txtCerca_TextChanged" TabIndex="-1" />
                                    &nbsp;
                                    <asp:CheckBox ID="chkOpzione" runat="server" AutoPostBack="True" OnCheckedChanged="chkOpzione_CheckedChanged" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:GridView ID="grView" runat="server" OnSelectedIndexChanged="grView_SelectedIndexChanged"
                            AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="ods"
                            GridLines="None" OnDataBound="grView_DataBound" DataKeyNames="value" Width="500px"
                            OnPageIndexChanged="grView_PageIndexChanged">
                            <RowStyle CssClass="ctrRowStyle" />
                            <AlternatingRowStyle CssClass="ctrAltRowStyle" />
                            <EditRowStyle CssClass="ctrEditRowStyle" />
                            <SelectedRowStyle CssClass="ctrSelRowStyle" />
                            <FooterStyle CssClass="ctrFooter" BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
                            <HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
                            <Columns>
                                <asp:TemplateField ShowHeader="False">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Select"
                                            Text='<%# traduci("Sel") %>' TabIndex="-1"></asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField ShowHeader="false">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblValue" Text='<%# Eval("value") %>' Visible='<%# isValueVisible %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="label" HeaderText="label" SortExpression="label" HtmlEncode="false" />
                            </Columns>
                        </asp:GridView>
                        <asp:Label ID="lblNumRec" runat="server" CssClass="didascalia" />&nbsp;&nbsp;
                        <asp:ObjectDataSource ID="ods" runat="server" SelectMethod="getSelUdcByPart" TypeName="GMW_data.selData"
                            FilterExpression=" (label LIKE '%{0}%') " 
                            OldValuesParameterFormatString="original_{0}">
                            <FilterParameters>
                                <asp:SessionParameter DefaultValue="*" Name="ricercaPopup" SessionField="ricercaPopup" />
                            </FilterParameters>
                        </asp:ObjectDataSource>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Panel>
