-1

I bind my DevExpress XtraGrid to a SQL Server database. I use the default navigator to delete rows. I would like the database to reflect these deletions as well. How do I do this?

Erik

Enrico
  • 1,937
  • 3
  • 27
  • 40

1 Answers1

-1

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>
Michael D. Irizarry
  • 6,186
  • 5
  • 30
  • 35