IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

ASP.NET Discussion :

GridView - Pager avec Update Panel


Sujet :

ASP.NET

  1. #1
    Membre du Club
    Inscrit en
    Octobre 2005
    Messages
    132
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 132
    Points : 53
    Points
    53
    Par défaut GridView - Pager avec Update Panel
    Bonjour,
    je charge un gridview dans un update panel (ajax), tout se passe bien sauf l'utilisation du "pager" ; quand je clique sur un numéro de page, rien ne se passe... quelqu'un aurait il une idée s'il vous plait ?

    Merci d'avance

  2. #2
    Membre extrêmement actif
    Avatar de zooffy
    Homme Profil pro
    Chef de projet MOA
    Inscrit en
    Août 2004
    Messages
    3 895
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Chef de projet MOA
    Secteur : Bâtiment

    Informations forums :
    Inscription : Août 2004
    Messages : 3 895
    Points : 1 434
    Points
    1 434
    Par défaut
    Vérifie les Triggers de l'UP sur le bon évènement du PAger.

    Réponse rapide, jsute avant de aprtir en Week-end, donc.......
    Mon blog de création d'univers : Qualhiryann
    Mon site qui parle de moi www.ozouf.com
    Pour les joueurs de WOW je suis sur Ysondres et mon perso est Ablanore.

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2007
    Messages
    312
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2007
    Messages : 312
    Points : 411
    Points
    411
    Par défaut
    fais voir ton code de déclaration de ton updPanel ( aspx ) stp.

  4. #4
    Membre du Club
    Inscrit en
    Octobre 2005
    Messages
    132
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 132
    Points : 53
    Points
    53
    Par défaut
    Salut, voici le code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
            <asp:UpdatePanel ID="UpdatePanel_boutons" runat="server">
                <ContentTemplate>
                    <asp:Panel ID="Panel1" runat="server" Height="24px" Width="960px">
                        <br />
                        <asp:Panel ID="Panel_boutons" runat="server" BorderStyle="Solid" BorderWidth="2px" Height="50px"
                            Width="944px">
                            <br />
                            <br />
                            &nbsp; &nbsp;<asp:Button ID="Button_all_demandes" runat="server" OnClick="Button_all_demandes_Click"
                            Text="Toutes Mes demandes" Font-Bold="False" Width="152px" BackColor="InactiveCaptionText" BorderStyle="Solid" BorderWidth="1px" />
                            &nbsp;<asp:Button ID="Button_demandes_en_attente" runat="server"
                                OnClick="Button_demandes_en_attente_Click" Text="Mes Demandes en attentes" Font-Bold="True" Width="184px" BackColor="InactiveCaptionText" BorderStyle="Solid" BorderWidth="1px" />
                            <asp:Button ID="Button_all_ddes" runat="server" OnClick="Button_all_ddes_Click" Text="Toutes Demandes" Width="136px" BackColor="InactiveCaptionText" BorderStyle="Solid" BorderWidth="1px" />
                            <asp:Button ID="Button_nouvelle_demande" runat="server" OnClick="Button_nouvelle_demande_Click"
                            Text="Nouvelle Demande" Font-Bold="True" Width="136px" BackColor="InactiveCaptionText" BorderStyle="Solid" BorderWidth="1px" />&nbsp;<asp:Button ID="Button_stats"
                                runat="server" OnClick="Button_stats_Click" Text="Statistiques" BackColor="InactiveCaptionText" BorderStyle="Solid" BorderWidth="1px" />&nbsp;
                            <asp:Button ID="Button_acceuil" runat="server" Text="Accueil" BackColor="LightCyan" BorderStyle="Solid" BorderWidth="1px" /><br />
                            &nbsp; &nbsp;&nbsp;
                            <asp:Label ID="Label4" runat="server" Font-Names="GE Inspira" Text="Classé par" Font-Italic="True"></asp:Label>
                        <asp:DropDownList ID="DropDownList_tri" runat="server" Width="136px">
                            <asp:ListItem Value=" date_demande">Date</asp:ListItem>
                            <asp:ListItem>Montant</asp:ListItem>
                            <asp:ListItem Value="convert(nvarchar,Nature)">Nature</asp:ListItem>
                        </asp:DropDownList>&nbsp;
                        <asp:CheckBox ID="CheckBox_tri" runat="server" Font-Names="GE Inspira" Font-Size="10pt"
                            Text="Décroissant" /><br />
                        </asp:Panel>
                        &nbsp; &nbsp;&nbsp;<br />
                        &nbsp; &nbsp;&nbsp;&nbsp;
                    </asp:Panel>
                </ContentTemplate>
            </asp:UpdatePanel>

  5. #5
    Membre extrêmement actif
    Avatar de zooffy
    Homme Profil pro
    Chef de projet MOA
    Inscrit en
    Août 2004
    Messages
    3 895
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Chef de projet MOA
    Secteur : Bâtiment

    Informations forums :
    Inscription : Août 2004
    Messages : 3 895
    Points : 1 434
    Points
    1 434
    Par défaut
    Juste ne lisant ton code il manque deux truc par rapport à ton énoncé :
    - les triggers
    - le grid view

    Si tu les rajoutes, peut être que ça ira.
    Mon blog de création d'univers : Qualhiryann
    Mon site qui parle de moi www.ozouf.com
    Pour les joueurs de WOW je suis sur Ysondres et mon perso est Ablanore.

  6. #6
    Membre du Club
    Inscrit en
    Octobre 2005
    Messages
    132
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 132
    Points : 53
    Points
    53
    Par défaut
    désolé !! je me suis trompé dUP ; voici le code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                <ContentTemplate>
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateSelectButton="True" CellPadding="4" Font-Names="GE Inspira"
                        ForeColor="#333333" GridLines="None" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" DataKeyNames="ID" OnPageIndexChanged="GridView1_PageIndexChanged" OnPageIndexChanging="GridView1_PageIndexChanging" AllowPaging="True" AutoGenerateColumns="False" PageSize="5">
                        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                        <SelectedRowStyle BackColor="#C5BBAF" ForeColor="#333333" BorderColor="Red" BorderStyle="Double" BorderWidth="2px" Font-Bold="True" />
                        <PagerStyle BackColor="InactiveCaption" ForeColor="White" HorizontalAlign="Center" Font-Bold="True" Font-Size="Small" />
                        <HeaderStyle BackColor="InactiveCaption" Font-Bold="True" ForeColor="Black" />
                        <AlternatingRowStyle BackColor="White" />
                        <RowStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" BackColor="InactiveCaptionText" />
                        <EditRowStyle BackColor="#7C6F57" />
                        <PagerSettings PageButtonCount="5" Position="Top" />
                    </asp:GridView>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;
                    <asp:Label ID="Label_ligne" runat="server" Text="Label" Visible="False"></asp:Label>&nbsp;
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="GridView1" EventName="PageIndexChanged" />
                    <asp:AsyncPostBackTrigger ControlID="GridView1" EventName="PageIndexChanging" />
                </Triggers>
            </asp:UpdatePanel>

  7. #7
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2007
    Messages
    312
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2007
    Messages : 312
    Points : 411
    Points
    411
    Par défaut
    Les triggers sont pas obligatoires, il prend par défaut les enfants de l'updatepanel comme triggers

  8. #8
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2007
    Messages
    312
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2007
    Messages : 312
    Points : 411
    Points
    411
    Par défaut
    Tu as peu etre une exception au moment de ta requete ajax, si tu as firebug tu peux le voir dans ta reponse, ou sinon en lancant ton projet en debug (f5) tu le saura

  9. #9
    Membre extrêmement actif
    Avatar de zooffy
    Homme Profil pro
    Chef de projet MOA
    Inscrit en
    Août 2004
    Messages
    3 895
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Chef de projet MOA
    Secteur : Bâtiment

    Informations forums :
    Inscription : Août 2004
    Messages : 3 895
    Points : 1 434
    Points
    1 434
    Par défaut
    Et côté CodeBehind, tu as quoi ?

    Perso, sur le PageIndexChanged je fais un DataBind()

    Egalement, je ne vois pas source de donnée : SqlDataSoucre ou DataTable ?
    Mon blog de création d'univers : Qualhiryann
    Mon site qui parle de moi www.ozouf.com
    Pour les joueurs de WOW je suis sur Ysondres et mon perso est Ablanore.

  10. #10
    Membre du Club
    Inscrit en
    Octobre 2005
    Messages
    132
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 132
    Points : 53
    Points
    53
    Par défaut
    J'utilise une sqldatasource. Merci pour les infos, je vais essayer d'executer un databind. Is cela ne fonctionne pas je ferais un debugage pas à pas.

    Merci encore !

  11. #11
    Membre du Club
    Inscrit en
    Octobre 2005
    Messages
    132
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 132
    Points : 53
    Points
    53
    Par défaut
    je viens d'ajouter un databind, et maintenant le gridview disparait au moment où je clique sur la page 2...

  12. #12
    Membre extrêmement actif
    Avatar de zooffy
    Homme Profil pro
    Chef de projet MOA
    Inscrit en
    Août 2004
    Messages
    3 895
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Chef de projet MOA
    Secteur : Bâtiment

    Informations forums :
    Inscription : Août 2004
    Messages : 3 895
    Points : 1 434
    Points
    1 434
    Par défaut
    Lorsque tu dis que le GridView disparait, tu veux dire qu'il te reste jsute la colonne "Selectionner" ?
    Si c'est ça, montre nous comment tu fabrique tes colonne
    Si c'est pas ça, il manque du code dans ce que tu nous a envoyer, car ce que tu expose n'est pas possible en l'état du code que l'on a dans le topic.
    Mon blog de création d'univers : Qualhiryann
    Mon site qui parle de moi www.ozouf.com
    Pour les joueurs de WOW je suis sur Ysondres et mon perso est Ablanore.

  13. #13
    Membre du Club
    Inscrit en
    Octobre 2005
    Messages
    132
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 132
    Points : 53
    Points
    53
    Par défaut
    Voici comment sont chargées les données :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
       '------------------------------------------------------------
            'CONNEXION SQL SERVER POUR RECEPTION ET SAUVEGARDE DES DONNEES
            Dim ds_sql As DataSet = New DataSet
            Dim da_sql As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter
            Dim maconnexion_sql As SqlClient.SqlConnection = New SqlClient.SqlConnection
            Dim connexion_string_sql As String
            Dim commande_sql As SqlClient.SqlCommand = New SqlClient.SqlCommand
            connexion_string_sql = "data source=FSEPAFRDTBS\SQLEXPRESS;Initial Catalog=Table_VHC_INVT;integrated security=true"
     
            maconnexion_sql.ConnectionString = connexion_string_sql
            maconnexion_sql.Open()
     
     
     
            'activation du tri en décroissant
            Dim tri As String
            If CheckBox_tri.Checked Then
                tri = (" DESC")
            Else
                tri = ("")
            End If
     
            'CHARGE LES NUMEROS DE DEMANDES
            commande_sql.Connection = maconnexion_sql
            commande_sql.CommandText = "select id,date_demande,statut from demandes ORDER BY " & DropDownList_tri.SelectedValue & tri
     
            'création d'un adapter pour lui enregistrer toutes les nouvelles lignes d'un coup
            da_sql.SelectCommand = commande_sql
            da_sql.Fill(ds_sql, "SQL_TABLE_TEMP")
     
     
            GridView1.AutoGenerateColumns = True
            GridView1.Visible = True
            GridView1.DataSource = ds_sql.Tables("SQL_TABLE_TEMP")
            GridView1.DataBind()
     
            maconnexion_sql.Close()
     
            Panel_details.Visible = True
    Sinon, pouvez vous me donner un exemple du code que vous mettez dans les gridview.pageindexchanged ?

  14. #14
    Membre du Club
    Inscrit en
    Octobre 2005
    Messages
    132
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 132
    Points : 53
    Points
    53
    Par défaut
    Si je fais le changement à la main dans le gridview.pageindexchanged, cela fonctionne, par exemple dans mon gridview.pageindexchanged :
    1) je charge mes données ;
    2 ) GridView1.PageIndex = 2

    Cela fonctionne, mais je souhaite utiliser les numéros de pages pour choisir la page à afficher, et là je n'y parviens pas...

  15. #15
    Membre extrêmement actif
    Avatar de zooffy
    Homme Profil pro
    Chef de projet MOA
    Inscrit en
    Août 2004
    Messages
    3 895
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Chef de projet MOA
    Secteur : Bâtiment

    Informations forums :
    Inscription : Août 2004
    Messages : 3 895
    Points : 1 434
    Points
    1 434
    Par défaut
    Dans le PageIndexChanged, je ne mets que ça : GridView1.DataBind()

    Autre point qui me perturbe. Tu mets le AutoGenerateColumns à False côté HTML, puis dans le CodeBehind tu le mets à True. Faut rester cohérent dans la vie, c'est mieu, non ?

    Donc fais ton choix, mais si tu mets False, ben faut gérer les colonnes à la main.

    Autre point encore, ce que tu présente là, n'est pas un SqlDataSource, c'est une DataTable.
    encore autre point. Dans ta définition côté HTML tu utilise un DAtaKey : mais, sauf si je dis une bétise, cele ne fonction qu'avec les SqlDataSource.

    Pour tenter de conclure. Commence par faire ton GridView tout seul, sur une page simple pour qu'il marche bien et ensuite, palce le dans un UupdatePanel.

    Kenavo
    Mon blog de création d'univers : Qualhiryann
    Mon site qui parle de moi www.ozouf.com
    Pour les joueurs de WOW je suis sur Ysondres et mon perso est Ablanore.

  16. #16
    Membre du Club
    Inscrit en
    Octobre 2005
    Messages
    132
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 132
    Points : 53
    Points
    53
    Par défaut
    Ok merci beaucoup pour cette aide, je vais faire d'autres tests sans update panel et avancer comme ça.

    Merci.

  17. #17
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2007
    Messages
    312
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2007
    Messages : 312
    Points : 411
    Points
    411
    Par défaut
    Zoofy les datakeys marchent aussi avec les datatables ( ou autres )

    Sinon l'idée de la page de test semble bonne, comme toujours:

    On fait un module qui marche dans une page de test puis on l'integre au site.

  18. #18
    Membre du Club
    Inscrit en
    Octobre 2005
    Messages
    132
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 132
    Points : 53
    Points
    53
    Par défaut
    J'ai retiré tous les updates panel et regénérer le projet et rien ne se passe lorsque je clique sur la page 2 ; voici mon code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    <asp:GridView ID="GridView1" runat="server" AutoGenerateSelectButton="True" CellPadding="4" Font-Names="GE Inspira"
                        ForeColor="#333333" GridLines="None" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" DataKeyNames="ID" OnPageIndexChanged="GridView1_PageIndexChanged" OnPageIndexChanging="GridView1_PageIndexChanging" AllowPaging="True" PageSize="5" BorderStyle="Solid" BorderWidth="1px" AllowSorting="True">
                        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                        <SelectedRowStyle BackColor="#C5BBAF" ForeColor="#333333" BorderColor="Red" BorderStyle="Double" BorderWidth="2px" Font-Bold="True" />
                        <PagerStyle BackColor="InactiveCaption" ForeColor="White" HorizontalAlign="Center" Font-Bold="True" Font-Size="Small" />
                        <HeaderStyle BackColor="InactiveCaption" Font-Bold="True" ForeColor="Black" />
                        <AlternatingRowStyle BackColor="White" />
                        <RowStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" BackColor="InactiveCaptionText" />
                        <EditRowStyle BackColor="#7C6F57" />
                        <PagerSettings PageButtonCount="5" Position="Top" />
                    </asp:GridView>

  19. #19
    Membre extrêmement actif
    Avatar de zooffy
    Homme Profil pro
    Chef de projet MOA
    Inscrit en
    Août 2004
    Messages
    3 895
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Chef de projet MOA
    Secteur : Bâtiment

    Informations forums :
    Inscription : Août 2004
    Messages : 3 895
    Points : 1 434
    Points
    1 434
    Par défaut
    Reposte ton CodeBehind, qu'on voit comment tu charge le bouzin.
    Poste également le reste du code HTML, il y a peut être un truc qui coince.
    Mon blog de création d'univers : Qualhiryann
    Mon site qui parle de moi www.ozouf.com
    Pour les joueurs de WOW je suis sur Ysondres et mon perso est Ablanore.

  20. #20
    Membre du Club
    Inscrit en
    Octobre 2005
    Messages
    132
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 132
    Points : 53
    Points
    53
    Par défaut
    voici le code HTML :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="RegulCompta_gestion.aspx.vb" Inherits="NucleusWeb.RegulCompta_new" %>
     
     
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Reguls Comptables - Nouvelles Demande</title>
        <link href="mvwres:34-WebGrid.Resources.WebGrid_Calendar.css,WebGrid, Version=2.2.2.0, Culture=neutral, PublicKeyToken=683aa60800d9b3ae"
            rel="stylesheet" type="text/css" />
        <link href="mvwres:34-WebGrid.Resources.WebGrid_Calendar.css,WebGrid, Version=2.2.2.0, Culture=neutral, PublicKeyToken=683aa60800d9b3ae"
            rel="stylesheet" type="text/css" />
        <link href="mvwres:34-WebGrid.Resources.WebGrid_Calendar.css,WebGrid, Version=2.2.2.0, Culture=neutral, PublicKeyToken=683aa60800d9b3ae"
            rel="stylesheet" type="text/css" />
        <link href="mvwres:35-WebGrid.Resources.WebGrid_Calendar.css,WebGrid, Version=2.2.2.0, Culture=neutral, PublicKeyToken=683aa60800d9b3ae"
            rel="stylesheet" type="text/css" />
        <link href="mvwres:50-WebGrid.Resources.WebGrid_Calendar.css,WebGrid, Version=2.2.2.0, Culture=neutral, PublicKeyToken=683aa60800d9b3ae"
            rel="stylesheet" type="text/css" />
        <link href="mvwres:54-WebGrid.Resources.WebGrid_Calendar.css,WebGrid, Version=2.2.2.0, Culture=neutral, PublicKeyToken=683aa60800d9b3ae"
            rel="stylesheet" type="text/css" />
        <link href="mvwres:17-WebGrid.Resources.WebGrid_Calendar.css,WebGrid, Version=2.2.2.0, Culture=neutral, PublicKeyToken=683aa60800d9b3ae"
            rel="stylesheet" type="text/css" />
        <link href="mvwres:2-WebGrid.Resources.WebGrid_Calendar.css,WebGrid, Version=2.2.2.0, Culture=neutral, PublicKeyToken=683aa60800d9b3ae"
            rel="stylesheet" type="text/css" />
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            &nbsp;<asp:Label ID="Label_appli" runat="server" Font-Bold="True" Font-Names="GE Inspira"
                Font-Size="Large" Text="Label"></asp:Label><br />
            <asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Names="GE Inspira" Font-Size="16pt"
                ForeColor="ActiveCaption" Text="Gestion des Regularisations Comptables"></asp:Label><br />
            <br />
            &nbsp;
            <asp:Label ID="Label_message" runat="server" Font-Bold="True" Font-Names="GE Inspira"
                Font-Size="Large" ForeColor="Red" Text="Label" Visible="False"></asp:Label><br />
            <asp:Label ID="Label_SSO" runat="server" Text="Label"></asp:Label>
                        <asp:Panel ID="Panel_boutons" runat="server" BorderStyle="Solid" BorderWidth="2px" Height="50px"
                            Width="944px">
                            <br />
                            <br />
                            &nbsp; &nbsp;<asp:Button ID="Button_all_demandes" runat="server" OnClick="Button_all_demandes_Click"
                            Text="Toutes Mes demandes" Font-Bold="False" Width="152px" BackColor="InactiveCaptionText" BorderStyle="Solid" BorderWidth="1px" />
                            &nbsp;<asp:Button ID="Button_demandes_en_attente" runat="server"
                                OnClick="Button_demandes_en_attente_Click" Text="Mes Demandes en attentes" Font-Bold="True" Width="184px" BackColor="InactiveCaptionText" BorderStyle="Solid" BorderWidth="1px" />
                            <asp:Button ID="Button_all_ddes" runat="server" OnClick="Button_all_ddes_Click" Text="Toutes Demandes" Width="136px" BackColor="InactiveCaptionText" BorderStyle="Solid" BorderWidth="1px" />
                            <asp:Button ID="Button_nouvelle_demande" runat="server" OnClick="Button_nouvelle_demande_Click"
                            Text="Nouvelle Demande" Font-Bold="True" Width="136px" BackColor="InactiveCaptionText" BorderStyle="Solid" BorderWidth="1px" />&nbsp;<asp:Button ID="Button_stats"
                                runat="server" OnClick="Button_stats_Click" Text="Statistiques" BackColor="InactiveCaptionText" BorderStyle="Solid" BorderWidth="1px" />&nbsp;
                            <asp:Button ID="Button_acceuil" runat="server" Text="Accueil" BackColor="LightCyan" BorderStyle="Solid" BorderWidth="1px" /><br />
                            &nbsp; &nbsp;&nbsp;
                            <asp:Label ID="Label4" runat="server" Font-Names="GE Inspira" Text="Classé par" Font-Italic="True"></asp:Label>
                        <asp:DropDownList ID="DropDownList_tri" runat="server" Width="136px">
                            <asp:ListItem Value=" date_demande">Date</asp:ListItem>
                            <asp:ListItem>Montant</asp:ListItem>
                            <asp:ListItem Value="convert(nvarchar,Nature)">Nature</asp:ListItem>
                        </asp:DropDownList>&nbsp;
                        <asp:CheckBox ID="CheckBox_tri" runat="server" Font-Names="GE Inspira" Font-Size="10pt"
                            Text="Décroissant" /><br />
                        </asp:Panel>
            &nbsp;<br />
            &nbsp;&nbsp;
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateSelectButton="True" CellPadding="4" Font-Names="GE Inspira"
                        ForeColor="#333333" GridLines="None" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" DataKeyNames="ID" OnPageIndexChanged="GridView1_PageIndexChanged" OnPageIndexChanging="GridView1_PageIndexChanging" PageSize="5" BorderStyle="Solid" BorderWidth="1px" AllowSorting="True">
                        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                        <SelectedRowStyle BackColor="#C5BBAF" ForeColor="#333333" BorderColor="Red" BorderStyle="Double" BorderWidth="2px" Font-Bold="True" />
                        <PagerStyle BackColor="InactiveCaption" ForeColor="White" HorizontalAlign="Center" Font-Bold="True" Font-Size="Small" />
                        <HeaderStyle BackColor="InactiveCaption" Font-Bold="True" ForeColor="Black" />
                        <AlternatingRowStyle BackColor="White" />
                        <RowStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" BackColor="InactiveCaptionText" />
                        <EditRowStyle BackColor="#7C6F57" />
                        <PagerSettings PageButtonCount="5" Position="Top" />
                    </asp:GridView>
            &nbsp;
            <asp:Button ID="Button_precedent" runat="server" Text=" - " />
            <asp:Button ID="Button_suivant" runat="server" Text=" + " /><br />
                    <asp:Label ID="Label_ligne" runat="server" Text="Label" Visible="False"></asp:Label>
            &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
            <asp:Panel ID="Panel_details" runat="server" Height="184px" Width="808px" Visible="False" BackImageUrl="~/Images/fond_beige.jpg" BorderColor="#404040" BorderStyle="Solid" BorderWidth="1px" style="background-color: white" BackColor="WhiteSmoke">
                        <span style="font-family: GE Inspira"><strong><span style="background-color: #99ff66">
                            </span>
                        </strong></span>
                        <br />
                        <span style="font-family: GE Inspira"><strong>&nbsp; Numéro de demande</strong> </span>
                        <asp:TextBox ID="TextBox_ID" runat="server" Font-Bold="True" Font-Names="GE Inspira" ReadOnly="True"></asp:TextBox><span style="font-family: GE Inspira">&nbsp;
                            Date de la demande</span><asp:TextBox ID="TextBox_date_demande" runat="server" ReadOnly="True"></asp:TextBox><span
                                style="font-family: GE Inspira">
                                <br />
                                <br />
                                <strong>&nbsp; Accords</strong>&nbsp; </span>
                        <asp:Label ID="Label2" runat="server" Font-Names="GE Inspira" Text="RSC"></asp:Label><span
                            style="font-family: GE Inspira">
                            <asp:TextBox ID="TextBox_RSC" runat="server" Width="32px" ReadOnly="True"></asp:TextBox>
                            &nbsp;&nbsp; </span>
                        <asp:Label ID="Label3" runat="server" Font-Names="GE Inspira" Text="DIRECTEUR DES VENTES"></asp:Label>
                        &nbsp;<asp:TextBox ID="TextBox_DV" runat="server" Width="32px" ReadOnly="True"></asp:TextBox>
                        &nbsp;<span style="font-family: GE Inspira"> </span>
                        <asp:Label ID="Label5" runat="server" Font-Names="GE Inspira" Text="DIRECTEUR FINANCIER"></asp:Label>&nbsp;
                        <asp:TextBox ID="TextBox_DAF" runat="server" Font-Bold="True" Width="32px"></asp:TextBox><br />
                        <br />
                        <span style="font-family: GE Inspira">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                            <asp:Panel ID="Panel2" runat="server" BorderStyle="Solid" BorderWidth="1px" Height="24px"
                                Width="648px" BackColor="InactiveCaptionText">
                                &nbsp; Statut &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                <asp:TextBox ID="TextBox_statut" runat="server" Font-Bold="True" Font-Names="GE Inspira" Font-Size="11pt" ForeColor="#FF0000" ReadOnly="True" Width="152px"></asp:TextBox><span style="font-family: GE Inspira">
                            &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Num de contrat </span>
                        <asp:TextBox ID="TextBox_num_contrat" runat="server" ReadOnly="True"></asp:TextBox><span style="font-family: GE Inspira">&nbsp;</span></asp:Panel>
                        </span><span style="font-family: GE Inspira">
                            <br />
                            <asp:Panel ID="Panel3" runat="server" BorderStyle="Solid" BorderWidth="1px" Height="24px"
                                Width="648px" BackColor="InactiveCaptionText">
                                &nbsp; Immatriculation&nbsp; &nbsp;<asp:TextBox ID="TextBox_immatriculation" runat="server" ReadOnly="True"></asp:TextBox><span style="font-family: GE Inspira"> &nbsp;
                            &nbsp; &nbsp; &nbsp;&nbsp;
                            Client&nbsp; </span>
                        <asp:TextBox ID="TextBox_Cust_nbr" runat="server" ReadOnly="True"></asp:TextBox>&nbsp;</asp:Panel>
                            <br />
                            <asp:Panel ID="Panel4" runat="server" BorderStyle="Solid" BorderWidth="1px" Height="24px"
                                Width="648px" BackColor="InactiveCaptionText">
                                &nbsp; Montant &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<asp:TextBox ID="TextBox_Montant" runat="server" ReadOnly="True"></asp:TextBox><span style="font-family: GE Inspira">
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Nature&nbsp; </span><asp:TextBox ID="TextBox_Nature" runat="server" ReadOnly="True"></asp:TextBox><span
                                style="font-family: GE Inspira">&nbsp;</span></asp:Panel>
                            &nbsp;<br />
                            &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                            </span><br /><span
                                style="font-family: GE Inspira">
                            </span>
                    </asp:Panel>
            &nbsp; &nbsp;<br />
            &nbsp;<br />
     
        </div>
        </form>
    </body>
    </html>
    et le codebehind :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
      '------------------------------------------------------------
            'CONNEXION SQL SERVER POUR RECEPTION ET SAUVEGARDE DES DONNEES
            Dim ds_sql As DataSet = New DataSet
            Dim da_sql As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter
            Dim maconnexion_sql As SqlClient.SqlConnection = New SqlClient.SqlConnection
            Dim connexion_string_sql As String
            Dim commande_sql As SqlClient.SqlCommand = New SqlClient.SqlCommand
            connexion_string_sql = "data source=FSEPAFRDTBS\SQLEXPRESS;Initial Catalog=Table_VHC_INVT;integrated security=true"
     
            maconnexion_sql.ConnectionString = connexion_string_sql
            maconnexion_sql.Open()
     
     
     
            'activation du tri en décroissant
            Dim tri As String
            If CheckBox_tri.Checked Then
                tri = (" DESC")
            Else
                tri = ("")
            End If
     
            'CHARGE LES NUMEROS DE DEMANDES
            commande_sql.Connection = maconnexion_sql
            commande_sql.CommandText = "select id,date_demande,statut from demandes ORDER BY " & DropDownList_tri.SelectedValue & tri
     
            'création d'un adapter pour lui enregistrer toutes les nouvelles lignes d'un coup
            da_sql.SelectCommand = commande_sql
            da_sql.Fill(ds_sql, "SQL_TABLE_TEMP")
     
     
            GridView1.AutoGenerateColumns = True
            GridView1.Visible = True
            GridView1.DataSource = ds_sql.Tables("SQL_TABLE_TEMP")
            GridView1.DataBind()
     
            maconnexion_sql.Close()
     
            Panel_details.Visible = True

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. Problème avec Update Panel, Timer et Send Boutton
    Par youtpout978 dans le forum ASP.NET
    Réponses: 5
    Dernier message: 06/05/2012, 12h32
  2. Réponses: 0
    Dernier message: 04/02/2009, 11h16
  3. probleme gridview dans update panel
    Par hachdotnet dans le forum ASP.NET
    Réponses: 7
    Dernier message: 12/08/2008, 17h01
  4. [AJAX] performances fortement diminuées avec un Update panel (et IE)?
    Par cortex024 dans le forum Général JavaScript
    Réponses: 1
    Dernier message: 28/06/2007, 12h40
  5. [C#] Travailler efficacement avec les panels dans une forme
    Par WwiloO dans le forum Windows Forms
    Réponses: 8
    Dernier message: 27/06/2005, 15h33

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo