Edit All rows in Datagrid

A

Alfredo Barrientos

Hi,

Is it possible editing all rows in datagrid?, i mean all fields are
enabled to edit?, and update all values in just one click?

Thanks,

Alfredo Barrientos
 
B

Brock Allen

You're not going to get any support from the Grid on this. You will have
to make everything an ItemTemplate and put the types on controls you want
the user to use for editing. You'll then have to handle the postback and
iterate over every row posted back and use something like FindControl to
find the posted controls to get their data. It's not hard, just a lot of
manual work.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
G

G Dean Blake

Alfredo,
This is very doable. Say you have five columns. Define five template
columns with textboxes in the itemtemplate and then five normal colums that
are not visible. You then bind the five columns from your datasource into
both sets of five colums. On the update button click event you spin through
the grid compare the template values to the non visible values (that
represent the original value) and then do updates where differences exist.

I do it all the time.

Regards,
Gary Blakely
Dean Blakely & Associates
www.deanblakely.com
 
A

Alfredo Barrientos

Hi Gary,

Thanks for answering, could you send any sample?

Thanks,

Alfredo Barrientos
 
A

Alfredo Barrientos

Thank you very much ae, this is a very powerfull sample.

Thanks,

Alfredo Barrientos
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top