<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RicercaSottostanti.aspx.cs" Inherits="OlympiaIntranet.RicercaSottostanti" %>

<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Data.Linq" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <dx:ASPxFormLayout ID="formLayout" runat="server" EnableTheming="True" Theme="Aqua">
                <Items>
                    <dx:LayoutGroup Caption="Selezione Titolo" ColCount="2" GroupBoxDecoration="Box">
                        <Items>
                            <dx:LayoutItem Caption="Titolo" ColSpan="1">
                                <LayoutItemNestedControlCollection>
                                    <dx:LayoutItemNestedControlContainer runat="server">
                                        <dx:ASPxGridLookup ID="gridlookupTitoli" runat="server" Theme="Aqua"
                                            Width="300px" AutoGenerateColumns="False" DataSourceID="SqlDSTitoli"
                                            IncrementalFilteringDelay="200" IncrementalFilteringMode="Contains"
                                            KeyFieldName="cod_tit" TextFormatString="{0} - {1}">
                                            <GridViewProperties>
                                                <SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" />
                                                <EditFormLayoutProperties ColCount="1" />
                                                <SettingsPopup>
                                                    <FilterControl AutoUpdatePosition="False" />
                                                </SettingsPopup>
                                            </GridViewProperties>
                                            <Columns>
                                                <dx:GridViewDataTextColumn FieldName="cod_tit" Caption="Titolo" VisibleIndex="0" />
                                                <dx:GridViewDataTextColumn FieldName="des_tit" Caption="Descrizione" VisibleIndex="2" />
                                                <dx:GridViewDataTextColumn Caption="ISIN" FieldName="cod_isin" VisibleIndex="1" />
                                            </Columns>
                                        </dx:ASPxGridLookup>
                                    </dx:LayoutItemNestedControlContainer>
                                </LayoutItemNestedControlCollection>
                            </dx:LayoutItem>

                            <dx:LayoutItem Caption="" ShowCaption="False" VerticalAlign="Middle">
                                <LayoutItemNestedControlCollection>
                                    <dx:LayoutItemNestedControlContainer runat="server">
                                        <dx:ASPxButton ID="btnCercaTitolo" runat="server" Theme="Aqua" OnClick="btnCercaTitolo_Click">
                                            <Image IconID="functionlibrary_lookupreference_16x16" />
                                        </dx:ASPxButton>
                                    </dx:LayoutItemNestedControlContainer>
                                </LayoutItemNestedControlCollection>
                            </dx:LayoutItem>
                        </Items>
                    </dx:LayoutGroup>
                    <dx:LayoutGroup Caption="Sottostanti trovati" ColSpan="1">
                        <Items>
                            <dx:LayoutItem Caption="" ColSpan="1">
                                <LayoutItemNestedControlCollection>
                                    <dx:LayoutItemNestedControlContainer runat="server">
                                        <dx:ASPxButton ID="btnEsportaExcel" runat="server" OnClick="btnEsportaExcel_Click" Theme="Aqua">
                                            <Image IconID="export_exporttoxlsx_16x16">
                                            </Image>
                                        </dx:ASPxButton>
                                    </dx:LayoutItemNestedControlContainer>
                                </LayoutItemNestedControlCollection>
                            </dx:LayoutItem>
                            <dx:LayoutItem Caption="" ColSpan="1">
                                <LayoutItemNestedControlCollection>
                                    <dx:LayoutItemNestedControlContainer runat="server">
                                        <dx:ASPxGridView ID="gvSottostantiTrovati" runat="server" Theme="Aqua" >
                                            <SettingsPopup>
                                                <FilterControl AutoUpdatePosition="False">
                                                </FilterControl>
                                            </SettingsPopup>
                                            <SettingsPager PageSize="25" Mode="ShowPager">
                                            </SettingsPager>
                                            <Settings ShowFilterRow="True" ShowHeaderFilterButton="True" ShowFilterBar="Visible" />
                                        </dx:ASPxGridView>
                                    </dx:LayoutItemNestedControlContainer>
                                </LayoutItemNestedControlCollection>
                            </dx:LayoutItem>
                        </Items>
                    </dx:LayoutGroup>
                </Items>
            </dx:ASPxFormLayout>
        </div>
        <dx:ASPxGridViewExporter ID="ExporterRicercaSottostanti" runat="server" GridViewID="gvSottostantiTrovati">
        </dx:ASPxGridViewExporter>
        <asp:SqlDataSource ID="SqlDSTitoli" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>" ProviderName="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection.ProviderName %>" SelectCommand="VaR_ElencoTitoli_LS" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDSRicercaSottostanti" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>" ProviderName="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection.ProviderName %>" SelectCommand="oi_RicercaSottostanti" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:SessionParameter Name="Titolo" SessionField="Titolo" />
            </SelectParameters>
        </asp:SqlDataSource>
    </form>
</body>
</html>
