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

<%@ 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">
    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous" />

    <title></title>
    <script>
        function OnFirstEndCallback(s, e) {

            // azzera eventuale selezione in gridLookupLinea
            clientgridLookupLinea.SetValue(null);

            // azzera eventuale selezione in gridLookupConsulente 
            clientgridLookupConsulente.SetValue(null);
        }
        function onShowPopup(x, y, text) {
            lbl.SetText(text);
            popup.ShowAtPos(x, y);
        }

        function onHidePopup() {  
        popup.Hide();  
    } 
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <table>
            <tr>
                <td>
                    <div>
                        <dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" ColCount="2" EnableTheming="True" Theme="Aqua" ColumnCount="2">
                            <Items>
                                <dx:LayoutGroup Caption="Filtri Selezione" ColCount="5" ColSpan="1" ColumnCount="5">
                                    <Items>
                                        <dx:LayoutItem Caption="Gestore" ColSpan="1">
                                            <LayoutItemNestedControlCollection>
                                                <dx:LayoutItemNestedControlContainer runat="server">
                                                    <dx:ASPxGridLookup ID="gridLookupGestore" runat="server" Theme="Aqua" DataSourceID="SqlDSGestori" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Gestore" TextFormatString="{0}" OnValueChanged="gridLookupGestore_ValueChanged">
                                                        <ClientSideEvents EndCallback="OnFirstEndCallback" />
                                                        <GridViewProperties>
                                                            <SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
                                                            <SettingsPager Mode="ShowAllRecords">
                                                            </SettingsPager>
                                                        </GridViewProperties>
                                                    </dx:ASPxGridLookup>
                                                </dx:LayoutItemNestedControlContainer>
                                            </LayoutItemNestedControlCollection>
                                        </dx:LayoutItem>
                                        <dx:LayoutItem Caption="Consulente" ColSpan="1">
                                            <LayoutItemNestedControlCollection>
                                                <dx:LayoutItemNestedControlContainer runat="server">
                                                    <dx:ASPxGridLookup ID="gridLookupConsulente" ClientInstanceName="clientgridLookupConsulente" runat="server" Theme="Aqua" DataSourceID="SqlDSConsulenti" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Consulente" TextFormatString="{0}">
                                                        <GridViewProperties>
                                                            <SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
                                                            <SettingsPager Mode="ShowAllRecords">
                                                            </SettingsPager>
                                                        </GridViewProperties>
                                                    </dx:ASPxGridLookup>
                                                </dx:LayoutItemNestedControlContainer>
                                            </LayoutItemNestedControlCollection>
                                        </dx:LayoutItem>
                                        <dx:LayoutItem Caption="Linea di Gestione" ColSpan="1">
                                            <LayoutItemNestedControlCollection>
                                                <dx:LayoutItemNestedControlContainer runat="server">
                                                    <dx:ASPxGridLookup ID="gridLookupLinea" ClientInstanceName="clientgridLookupLinea" runat="server" Theme="Aqua" DataSourceID="SqlDSLinee" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Linea" TextFormatString="{0}">
                                                        <GridViewProperties>
                                                            <SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
                                                            <SettingsPager Mode="ShowAllRecords">
                                                            </SettingsPager>
                                                        </GridViewProperties>
                                                    </dx:ASPxGridLookup>
                                                </dx:LayoutItemNestedControlContainer>
                                            </LayoutItemNestedControlCollection>
                                        </dx:LayoutItem>
                                        <dx:LayoutItem Caption="Esposizione Titoli" ColSpan="1">
                                            <LayoutItemNestedControlCollection>
                                                <dx:LayoutItemNestedControlContainer runat="server">
                                                    <dx:ASPxButton ID="buttonEsposizioneTitoli" runat="server" Theme="Aqua" OnClick="buttonEsposizioneTitoli_Click">
                                                        <Image IconID="grid_grid_16x16">
                                                        </Image>
                                                    </dx:ASPxButton>
                                                </dx:LayoutItemNestedControlContainer>
                                            </LayoutItemNestedControlCollection>
                                        </dx:LayoutItem>
                                    </Items>
                                </dx:LayoutGroup>
                            </Items>
                        </dx:ASPxFormLayout>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div>
                        <dx:ASPxGridView ID="gvEsposizioneTitoli" runat="server" Theme="Aqua" OnHtmlDataCellPrepared="gvEsposizioneTitoli_HtmlDataCellPrepared" OnHtmlRowPrepared="gvEsposizioneTitoli_HtmlRowPrepared">
                            <SettingsPager PageSize="20" Mode="ShowAllRecords">
                            </SettingsPager>
                            <SettingsDataSecurity AllowDelete="False" AllowEdit="False" AllowInsert="False" />
                            <SettingsSearchPanel Visible="True" />
                            <Templates>
                                <GroupRowContent>
                                    <a id="clickElement" target="_blank" href="SelettoreFondiETF.aspx?categoriaMS=<%# Eval("CategoriaMS").ToString()%>&divisa=<%# Eval("DivisaTitolo").ToString()%>&isinTitolo=<%# Eval("ISIN Titolo").ToString()%>"><%# Eval("Titolo").ToString()%></a>
                                </GroupRowContent>
                            </Templates>
                        </dx:ASPxGridView>
                        <dx:ASPxPopupControl ID="ASPxPopupControl1" runat="server" ClientInstanceName="popup" ShowHeader="false">
                            <ContentCollection>
                                <dx:PopupControlContentControl runat="server">
                                    <dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="ASPxLabel" ClientInstanceName="lbl">
                                    </dx:ASPxLabel>
                                </dx:PopupControlContentControl>
                            </ContentCollection>
                        </dx:ASPxPopupControl>
                    </div>
                </td>
            </tr>
        </table>

        <asp:SqlDataSource ID="SqlDSGestori" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Gestori" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDSLinee" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Linee" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:SessionParameter Name="cod_ges" SessionField="cod_ges" />
                <asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDSConsulenti" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Consulenti" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:SessionParameter Name="cod_ges" SessionField="cod_ges" />
                <asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </form>

    <!-- Option 1: Bootstrap Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>

</body>
</html>

