Robert
Robert

Reputation: 1726

ASP.NET - Get gridview edit row to span across columns

I've got a grid control with 6 columns. I use the EditItemTemplate fields to display edit data and I'd like to customize this if possible. Right now, the EditItemTemplate will show any control that I put in there but it only displays it in the column in which the template is in. How can I get it to span across all 6 columns? For instance, the 6 columns are:

First Name | Last Name | Address | City | State | Zip

and when the user clicks the Edit button (in each row), I'd like to show those 6 for edit, but add 1 more control on a row below that, which spans all 6 columns:

First Name | Last Name | Address | City | State | Zip
------------------------------------------------------
UserComments
------------------------------------------------------

Any ideas how I can accomplish this or even if it can be done?

Upvotes: 1

Views: 3053

Answers (1)

zeroef
zeroef

Reputation: 1969

You can modify the gridview control by hooking up to the OnRowCreated event.

I found a very comprehensive tutorial here: Rows and Columns Merging in ASP.NET GridView Control

In the posted article, the author takes a gridview like this: http://i.imgur.com/XyaFw.png

And transforms it to this: http://i.imgur.com/XyaFw.png

Upvotes: 3

Related Questions