1

SQLDataSourceによって次のスキーマを持つテーブルにバインドされたAjaxControlToolkitReorderListがあります。

OrgIDマイルストーンID名の優先度

Priorityフィールドは、SortOrderFieldとしてReorderListに付加されます。OrgIDは、ログインする各ユーザーに固有です。アイデアは、組織ごとに異なるマイルストーンのリストがあるということです。

ノーコード開発プラットフォームを使用しています。EditItemTemplateには、更新とキャンセル用の2つのImageButtonがあります。[更新]をクリックすると、マイルストーンの名前は更新されますが、優先度はnullに設定されます。なぜこれが起こっているのか理解できません。

ReorderListとそのSQLDataSourceのソースコードは次のとおりです。

<cc1:ReorderList ID="ReorderList1" runat="server" AllowReorder="True" 
            CssClass="reorderStyle" DataKeyField="MilestoneID" 
            DataSourceID="SqlDataSource2"
            OnItemDataBound="ReorderList1_ItemDataBound" 
            OnItemReorder="ReorderList1_ItemReorder" PostBackOnReorder="True" 
                    SortOrderField="Priority" Width="400px">
                    <ItemTemplate>
                        <asp:ImageButton ID="ImageButton2" runat="server" CommandName="Edit" 
                            ImageUrl="~/Images/edit.gif" />
                        <asp:Label ID="Label1" runat="server"
                    Text='<%# Eval("Name") %>' 
                    ForeColor="Navy" Font-Names="Arial" />
                    </ItemTemplate>
                    <DragHandleTemplate>
                        <img src="../Images/GrabIcon.GIF" style="cursor: move" />&nbsp;
                    </DragHandleTemplate>
                    <InsertItemTemplate>
                    </InsertItemTemplate>
                    <EmptyListTemplate>
                        <asp:Label ID="Label4" runat="server" Font-Bold="True" Font-Italic="False" ForeColor="Red"
                    Text="There are no Associated Milestones currently in the database"></asp:Label>
                    </EmptyListTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox>
                        <asp:ImageButton ID="ImageButton1" runat="server" CommandName="Update" 
                            ImageUrl="~/Images/save.gif" />
                        &nbsp;
                        <asp:ImageButton ID="ImageButton3" runat="server" CommandName="Cancel" 
                            ImageUrl="~/Images/cancel.gif" />
                    </EditItemTemplate>
                </cc1:ReorderList>
                <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:MyConnectionString %>" 
                    DeleteCommand="DELETE FROM [Milestones] WHERE [MilestoneID] = @MilestoneID" 
                    InsertCommand="INSERT INTO [Milestones] ([OrgID], [Name], [Priority]) VALUES (@OrgID, @Name, @Priority)" 
                    SelectCommand="SELECT MilestoneID, [Name], [Priority] FROM [Milestones] WHERE OrgID = @OrgID ORDER BY [Priority]" 

                    UpdateCommand="UPDATE [Milestones] SET [Name] = @Name, Priority = @Priority WHERE [MilestoneID] = @MilestoneID">
                    <SelectParameters>
                        <asp:ProfileParameter Name="OrgID" PropertyName="OrgID" />
                    </SelectParameters>
                    <DeleteParameters>
                        <asp:Parameter DbType="Guid" Name="MilestoneID" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="Priority" Type="Int32" />
                        <asp:Parameter Name="Name" Type="String" />
                        <asp:Parameter DbType="Guid" Name="MilestoneID" />
                    </UpdateParameters>
                    <InsertParameters>
                        <asp:ProfileParameter Name="OrgID" PropertyName="OrgID" />
                        <asp:Parameter Name="Name" Type="String" />
                        <asp:Parameter Name="Priority" Type="Int32" />
                    </InsertParameters>
                </asp:SqlDataSource>

名前が更新されるのに優先度が更新されない理由はありますか?

4

1 に答える 1

2

ReoRder リスター コントロールを使用したことはありませんが、DataSource に送信するには Bind to Priority が必要だと思いましたか? 例えば。

<asp:TextBox ID="TextBoxPriorty" runat="server" Text='<%# Bind("Priority") %>'></asp:TextBox>
于 2009-07-21T20:37:00.087 に答える