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

<%@ 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>
    <style>
        html {
            width: 100%;
            height: 100%;
        }

        body {
            display: flex;
            justify-content: center;
            align-items: center;
        }
    </style>
    <script>
        function OnFirstEndCallback(s, e) {
            //clientgridLookupLinea.GetGridView().Refresh();

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

            // azzera eventuale selezione in gridLookupAdvisor 
            //clientgridLookupAdvisor.SetValue(null);
        }

        function OnFirstEndCallbackAdvisor(s, e) {
            // azzera eventuale selezione in gridLookupLinea
            //clientgridLookupLinea.SetValue(null);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" EnableTheming="True" Theme="Office2010Blue" Width="100%">
                <Items>
                    <dx:LayoutGroup Caption="Filtri Selezione" ColCount="6" ColSpan="1" ColumnCount="6">
                        <Items>
                            <dx:LayoutItem Caption="Gestore" ColSpan="1">
                                <LayoutItemNestedControlCollection>
                                    <dx:LayoutItemNestedControlContainer runat="server">
                                        <dx:ASPxGridLookup ID="gridLookupGestore" runat="server" Theme="Aqua" DataSourceID="" ValueType="System.String" 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>

                                                <SettingsPopup>
                                                    <FilterControl AutoUpdatePosition="False"></FilterControl>
                                                </SettingsPopup>
                                            </GridViewProperties>
                                        </dx:ASPxGridLookup>
                                    </dx:LayoutItemNestedControlContainer>
                                </LayoutItemNestedControlCollection>
                            </dx:LayoutItem>
<%--                            <dx:LayoutItem Caption="Advisor" ColSpan="1">
                                <LayoutItemNestedControlCollection>
                                    <dx:LayoutItemNestedControlContainer runat="server">
                                        <dx:ASPxGridLookup ID="gridLookupAdvisor" ClientInstanceName="clientgridLookupAdvisor" runat="server" Theme="Aqua" DataSourceID="SqlDSAdvisor" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Advisor" TextFormatString="{0}" OnValueChanged="gridLookupAdvisor_ValueChanged">
                                            <ClientSideEvents EndCallback="OnFirstEndCallbackAdvisor" />
                                            <GridViewProperties>
                                                <SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
                                                <SettingsPager Mode="ShowAllRecords">
                                                </SettingsPager>

                                                <SettingsPopup>
                                                    <FilterControl AutoUpdatePosition="False"></FilterControl>
                                                </SettingsPopup>
                                            </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>

                                                <SettingsPopup>
                                                    <FilterControl AutoUpdatePosition="False"></FilterControl>
                                                </SettingsPopup>
                                            </GridViewProperties>
                                        </dx:ASPxGridLookup>
                                    </dx:LayoutItemNestedControlContainer>
                                </LayoutItemNestedControlCollection>
                            </dx:LayoutItem>
                            <dx:LayoutItem Caption="" ColSpan="1">
                                <LayoutItemNestedControlCollection>
                                    <dx:LayoutItemNestedControlContainer runat="server">
                                        <dx:ASPxButton ID="buttonCaricaDati" runat="server" OnClick="buttonCaricaDati_Click" Theme="Aqua">
                                            <Image IconID="content_textbox_16x16">
                                            </Image>
                                        </dx:ASPxButton>
                                    </dx:LayoutItemNestedControlContainer>
                                </LayoutItemNestedControlCollection>
                            </dx:LayoutItem>
                            <dx:LayoutItem Caption="" ColSpan="1">
                                <LayoutItemNestedControlCollection>
                                    <dx:LayoutItemNestedControlContainer runat="server">
                                        <dx:ASPxButton ID="buttonEsportaExcel" runat="server" AutoPostBack="False" OnClick="buttonEsportaExcel_Click" Theme="Aqua">
<%--                                            <ClientSideEvents Click="function(s, e) { ExportChartToPdf(e); }" />--%>
                                            <Image IconID="export_exporttoxlsx_16x16">
                                            </Image>
                                        </dx:ASPxButton>
                                    </dx:LayoutItemNestedControlContainer>
                                </LayoutItemNestedControlCollection>
                            </dx:LayoutItem>
                        </Items>
                    </dx:LayoutGroup>
                </Items>
            </dx:ASPxFormLayout>
            <dx:ASPxGridView ID="gvPerformance1Day" runat="server" OnDataBound="gvPerformance1Day_DataBound" Theme="Office2010Blue" Width="100%" AutoGenerateColumns="False">
                <SettingsAdaptivity>
                    <AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
                </SettingsAdaptivity>
                <SettingsPager PageSize="15" Mode="ShowAllRecords">
                </SettingsPager>
                <Settings ShowFilterRow="True" ShowHeaderFilterButton="True" ShowTitlePanel="True" ShowFooter="true" />
                <EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
            </dx:ASPxGridView>
        </div>
        <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_GetLinee1" 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="SqlDSAdvisor" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GetAdvisor" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:SessionParameter Name="cod_ges" SessionField="cod_ges" />
                <asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>--%>
        <dx:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="gvPerformance1Day">
        </dx:ASPxGridViewExporter>
    </form>
</body>
</html>
