Bonjour,

J'utilise l'ajaxtoolkit, reorderlist. La page fonctionne je peux permuter les lignes cependant je n'arrive pas à enregistrer en base ces changements.
Que dois je faire ??

Voici mon 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<asp:ReorderList ID="ReorderList1" runat="server"
                               PostBackOnReorder="False"
                               DataSourceID="SqlDataSource1"
                               DataKeyField="them_id"
                               SortOrderField="them_ordre" 
                               Width="400px" 
                               AllowReorder="True" ShowInsertItem="True" 		>
 
	<ItemTemplate>
          <div class="itemArea">
            <asp:Label ID="Label1" runat="server"
                       Text='<%# Bind("them_libelle") %>' />
           </div>
        </ItemTemplate>
 
        <ReorderTemplate>
          <asp:Panel ID="Panel2" runat="server" CssClass="reorderCue" />
        </ReorderTemplate>
        <DragHandleTemplate>
          <div class="dragHandle"></div>
        </DragHandleTemplate>
        <InsertItemTemplate>
          <div style="padding-left:25px; border-bottom:thin solid transparent;">
            <asp:Panel ID="panel1" runat="server" DefaultButton="Button1">
              <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("them_libelle") %>' />
              <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("them_id") %>' />
              <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("them_ordre") %>' />
              <asp:Button ID="Button1" runat="server" CommandName="Insert" Text="Add" />
 
             </asp:Panel>
          </div>
        </InsertItemTemplate>
        </asp:ReorderList>
	<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
		ConnectionString="<%$ ConnectionStrings:infopresseConnectionString %>" 
		SelectCommand="SELECT [them_id], [them_libelle], [them_ordre] FROM [theme_table] order by [them_ordre]"
		UpdateCommand="UPDATE [theme_table] SET [them_ordre]=@them_ordre WHERE [them_id]=@them_id"
		InsertCommand="INSERT INTO [theme_table] ([them_id], [them_libelle], [them_ordre]) VALUES (@them_id, @them_libelle, @them_ordre)" 
                >
		<UpdateParameters>
            <asp:Parameter Name="them_ordre" Type="Int32" />
            <asp:Parameter Name="them_id" Type="Int32" />
        </UpdateParameters>
		<InsertParameters>
            <asp:Parameter Name="them_id" Type="Int32" />
            <asp:Parameter Name="them_libelle" Type="String" />
            <asp:Parameter Name="them_ordre" Type="Int32" />
        </InsertParameters>
	</asp:SqlDataSource>