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
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
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.......
fais voir ton code de déclaration de ton updPanel ( aspx ) stp.
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 /> <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" /> <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" /> <asp:Button ID="Button_stats" runat="server" OnClick="Button_stats_Click" Text="Statistiques" BackColor="InactiveCaptionText" BorderStyle="Solid" BorderWidth="1px" /> <asp:Button ID="Button_acceuil" runat="server" Text="Accueil" BackColor="LightCyan" BorderStyle="Solid" BorderWidth="1px" /><br /> <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> <asp:CheckBox ID="CheckBox_tri" runat="server" Font-Names="GE Inspira" Font-Size="10pt" Text="Décroissant" /><br /> </asp:Panel> <br /> </asp:Panel> </ContentTemplate> </asp:UpdatePanel>
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.
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> <asp:Label ID="Label_ligne" runat="server" Text="Label" Visible="False"></asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="GridView1" EventName="PageIndexChanged" /> <asp:AsyncPostBackTrigger ControlID="GridView1" EventName="PageIndexChanging" /> </Triggers> </asp:UpdatePanel>
Les triggers sont pas obligatoires, il prend par défaut les enfants de l'updatepanel comme triggers
Partager