开发者

How to delete a row from DevExpress Grid

I bind my DevExpress XtraGrid to a SQL Server database. I use the default navigator to del开发者_如何学Cete rows. I would like the database to reflect these deletions as well. How do I do this?

Erik


You should enable the ASPxGridView GridViewCommandColumn.

Here's an example using the Object Datasource but the concept is the same for any type.

<dxwgv:GridViewCommandColumn ShowSelectCheckbox="False" VisibleIndex="0" Caption="Projects">
    <DeleteButton Visible="True">
    </DeleteButton>
    <ClearFilterButton Visible="True"></ClearFilterButton>
</dxwgv:GridViewCommandColumn>

And have the aproppiate Datasource:

<asp:ObjectDataSource ID="MyDS" runat="server" 
        DeleteMethod="Delete"
        TypeName="Model.DataRepository">
        <DeleteParameters>
            <asp:Parameter Name="ID" Type="Int64" />
        </DeleteParameters>
</asp:ObjectDataSource>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜