Edit All Function for DataGrid, and Moving the Edit Function in a DataGrid

S

Schultz

is there an easy to follow, source code in one document, article that
explains how to create an edit all DataGrid control?


and, I have a DataGrid setup where the client enters information for
each row by clicking Edit-Update for each row. Each row has several
columns, is there anyway to move the Edit function to edit each column
individually for each row in the DataGrid?


I'll try to find an example for what I am talking about and post it
back to the thread.
 
G

Guest

Schultz, I can't point you to the easy to follow source code, but I'm sure
you can do what you're trying to do.

Skip the built-in edit logic, because that allows for only one edit row, and
all it really does for you is remember the row and give you an easy way to
enter the additional template.

Instead, give them an "edit all" button, and on select rebind all the labels
to text fields, etc. The mechanics are up to you, but easiest might be to
include both the label and the textbox in each cell, and in ItemDataBound set
the visible= of each to on/off as needed. Or, leave the cell empty for
starters, and in ItemDataBound add either a label or a textbox to the cell
(if you do it dynamically though you'll have more work to make sure the
data's there after postback).

I'd suggest something similar for the second part of your question: roll
your own and put an edit button in every cell if you want. Of course, editing
within the grid can get a little hairy with maintaining scroll position,
etc., esp. across browsers, and sometimes you're better off jumping to a
separate form.

hth,

Bill
 

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

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top