TAILIEUCHUNG - ASP.NET 4 Unleased - p 94

Building Data Access Components with FIGURE Tracking data row changes. LISTING protected void btnReject_Click(object sender, EventArgs e) { Movie9 movie = new Movie9(); (); (); } protected void btnAccept_Click(object sender, EventArgs e) { Movie9 movie = new Movie9(); (); (); } From the Library of Wow! eBook Disconnected Data Access 905 Show Movie9 Edit Movies | 904 CHAPTER 19 Building Data Access Components with FIGURE Tracking data row changes. LISTING @ Page Language C @ Import Namespace DOCTYPE html PUBLIC - W3C DTD XHTML Transitional EN http TR xhtml1 DTD script runat server protected void btnReject_Click object sender EventArgs e Movie9 movie new Movie9 protected void btnAccept_Click object sender EventArgs e Movie9 movie new Movie9 script html xmlns http 1999 xhtml From the Library of Wow eBook Disconnected Data Access 905 head id Head1 runat server title Show Movie9 title head body form id form1 runat server div h1 Edit Movies h1 asp GridView id grdMovies DataSourceID srcMovies DataKeyNames Id AutoGenerateEditButton true Runat server Columns asp TemplateField ItemTemplate DataRowView . ItemTemplate asp TemplateField Columns asp GridView br asp Button id btnReject Text Reject Changes OnClick btnReject_Click Runat server asp Button id btnAccept Text Accept Changes OnClick btnAccept_Click Runat server 19 asp ObjectDataSource id srcMovies TypeName Movie9 SelectMethod GetAll UpdateMethod Update Runat server div From the Library of Wow eBook 906 CHAPTER 19 Building Data Access Components with form body html If you click the Accept Changes button all the changes made to the rows in the GridView are sent to the database. If you click the Reject Changes button all the rows revert to their original values. Using the DataView Object The DataView object represents an in-memory database view. You can use a DataView object to create a sortable filterable view of a DataTable. The DataView object supports three important properties Sort Enables you to sort the rows represented by the DataView. RowFilter Enables you to filter the rows represented by the DataView. RowStateFilter Enables you to filter the rows represented