DetailsView (Insert, Update, Delete)

Discussion in 'Software' started by azeem, Oct 22, 2006.

  1. azeem

    azeem

    Joined:
    Oct 22, 2006
    Messages:
    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, Oct 22, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lee Something

    Cannot Delete, (The Delete Key Won't Work)

    Lee Something, Oct 15, 2003, in forum: Computer Support
    Replies:
    13
    Views:
    7,739
    trout
    Oct 15, 2003
  2. zZz
    Replies:
    1
    Views:
    1,007
    SgtMinor
    Jan 12, 2005
  3. Lethal

    To delete or not to delete?

    Lethal, Jul 22, 2005, in forum: Computer Support
    Replies:
    15
    Views:
    981
    Lethal
    Jul 25, 2005
  4. sakhu
    Replies:
    1
    Views:
    1,277
    sakhu
    Jul 5, 2007
  5. Sridhar Panatula

    What happens when I delete with Shift+Delete

    Sridhar Panatula, Sep 28, 2008, in forum: Windows 64bit
    Replies:
    6
    Views:
    1,307
    Sergey Wasilenkow
    Oct 6, 2008
Loading...

Share This Page