![]() |
|
|
|
#1 |
|
Hi,
I would like to know if anyone had tried insert, update, delete of data through DetailsView control in a datatable (not in the datasource directly using the dataadapter Or the datasourcecontrol). Whenever I click any of the command buttons (Insert, ..,....) the data should get inserted, updated Or deleted in the datatable (which is in memory locally) not in the datasource physically(sql server). And later whenever I'm finished with all the invoice lines (many records) I will update it using the dataadapter's update command OR using the datasourcecontrol (which is available with detailsview). And my insert, update & delete commands in the datatable locally will be through manual coding by using datatable.newrow & fill the data in the columns of the row & then finally datatable.rows.add(newrow). The problem what I'm facing is, when I'm inserting data into the datatable by clicking the 'insert command' (itemcommand event), the data gets updated in the datatable but the DetailsView control doesn't change to 'readonly' mode bcoz the defaultmode is readonly mode (even if I force it to change it to readonly despite of having more than 0 recordcount). It also fires modechanging event but it doesn't fire the 'modechanged event'. I'm struggling for it for quite a long time. The reason for doing is that first I'll fill all the invoice lines in my InvoiceDetails(footer) table then I'll fill one record in my invoiceHeader(header) table then when both tables are ready I'll update the datasource. Note: If my invoicedetails datatable is empty under that case I'll show a command button (emptydatatemplate), which once clicked shows the grid in 'insert mode'. This is for first time only when the recordcount is 0. Any help is really appreciated. bye......... AZEEM. azeem |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can't delete file or folder? | nork | Software | 1 | 11-02-2009 11:52 AM |
| Update and Delete From Gridview | Usman | Software | 0 | 11-01-2006 10:05 AM |
| How do I: Correctly deny the delete permission? | sundevilkid85 | Software | 0 | 05-08-2006 09:49 PM |
| Re: Question about MS critical updates | John Coode | A+ Certification | 0 | 06-30-2004 06:08 PM |
| Latest Tech Fiasco... | Ghost | A+ Certification | 30 | 01-09-2004 12:15 PM |