Datagrid edit all rows

Results 1 to 2 of 2

Thread: Datagrid edit all rows

  1. #1
    Join Date
    Dec 1969

    Default Datagrid edit all rows

    Is there a way to have all the rows in a datagrid editable at the same time? I've been looking at all the stuff built in for editing row by row, but I want all of the rows to come up as editable at one time and use one Save button to save all changes. How? Thanks.

  2. #2
    Join Date
    Dec 1969

    Default RE: Datagrid edit all rows

    You could use ItemTemplates for the DataGrid&#039;s Columns. The template should use a textbox instead of a label to allow the content to be edited. As far as saving the entire data, it depends on how you got it in the first place. I would use a dataset and fill it with a data adpter. Persist the dataset and then bind it to the grid. On post back (save clicked) get the original dataset back and iterate the rows and columns while substituting the values with those from the grid. Then use a data adapter again and call its update method with the dataset passed as an agrument to the function. You can read more about the update method here:<BR> sp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts