Bonjour à tous.

Je tente de faire une truc peut-être un peu scabreux, mais je patauge depuis Vendredi dessus.

J'ai fais deux GridView dans un UpdatePanel de la manière suivante :
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
<ajax:UpdatePanel ID="upGalerie" runat="server" ChildrenAsTriggers="true" UpdateMode="Always">
    <ContentTemplate>
        <table>
            <tr>
                <td>
                    <asp:SqlDataSource ID="sdsGalerie" runat="server" ConnectionString="<%$ ConnectionStrings:DataDev %>"></asp:SqlDataSource>
                    <asp:GridView ID="gvGalerie" runat="server" DataSourceID="sdsGalerie" DataKeyNames="IdGalerie"></asp:GridView>
                </td>
                <td>
                    <asp:SqlDataSource ID="sdsDetailGalerie" runat="server" ConnectionString="<%$ ConnectionStrings:DataDev %>"></asp:SqlDataSource>
                    <asp:GridView ID="gvDetailGalerie" runat="server" DataSourceID="sdsDetailGalerie" DataKeyNames="IdPhotoAntoine" ></asp:GridView>
                </td>
            </tr>
        </table>
    </ContentTemplate>
</ajax:UpdatePanel>
Ensuite je charge mon premier GridView à partir du CodeBehind comme cela :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        With sdsGalerie
            .SelectCommand = "SELECT * FROM ANTOINE_Galerie"
        End With
        With gvGalerie
            Dim btn As New ButtonField
            With btn
                .Text = "modifier"
            End With
            .Columns.Add(btn)
            .DataBind()
 
        End With
    End Sub
En ajoutant simplement un bouton modifier pour ouvrir et charger le deuxième gridView en fonction de la ligne choisie. L'action se fait comme suit :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
    Protected Sub gvGalerie_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gvGalerie.RowCommand
        With sdsDetailGalerie
            .SelectCommand = "SELECT * FROM ANTOINE_Galerie_Photo WHERE IdGalerie = '" & gvGalerie.DataKeys(e.CommandArgument).Value.ToString & "'"
        End With
        With gvDetailGalerie
            .AutoGenerateEditButton = True
            .DataBind()
 
        End With
    End Sub
Le GridView se charge trés correctement avec les bonnes données.
Le problème arrive maintenant : j'ai activé l'EditButton mais si je clique dessus le GRidView disparait, tout simplement.

Donc j'en déduis que je dois oublier de recharger un truc quelque part, mais là, je sèche, je ne vois pas quoi du tout.

Pouvez m'aider ?