Batch update in gridview?
I have a web page which let user data enter employee working hours. I
used datagrid to list all the employee and templateColumn to format the
workhours column to textbox for data entry. And have one save button to
submit all the hours that user entered. On the backend save button
clicked event, I mannually build my update statement to write the
workhours into database. Also, if the workhours field is not
editable(e.g the timesheet is submitted), I use <ItemTemplate> will
change it to label control.
I do not like use the editcommand etc 'cause that will require user to
click edit button to convert to edit mode- which by the way is very
annoying. But most example on the web is always assume that users are
happy to click a edit button and then update button row by row.
even for edit one record only, I think inline edit is not good because
most case, the datagrid just show the major information from a table
(space limitted or some info is just can be omitted), but if you want
add/edit the record, you need to provide values for all the fields.
For example, I have another page for employee info editing
So what I did is let the datagrid shows a list of employee info (First
name, last name, etc...), and when user select a employee I will
populate this employee's info to another area on the same page, this
editing area contains textbox. dropdownlist .. so that user can do
edit/add here. And now I am glad to see that I can use detailsview for
I like this approach and is worked very well for me.
As now we are move on to the GRIDVIEW/detailview/formview, do they have
something similiar to the approach I used, if they do not have, what is
the suggestion you guys have for these kind of batch update? user enter
data in multiple rows and click save button once to save the data.
Any suggestions /experience are appreciated.
|All times are GMT. The time now is 10:14 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.