开发者

Is it possible to create a table with a multi-level row using ASP.NET GridView or other control

开发者 https://www.devze.com 2023-02-27 00:15 出处:网络
I\'m not sure if I\'m using the correct terminology to describe my questions so I created a few mock ups to try to show what I am trying to do.

I'm not sure if I'm using the correct terminology to describe my questions so I created a few mock ups to try to show what I am trying to do.

I have an existing table listing order detail information that looks something like this:

Is it possible to create a table with a multi-level row using ASP.NET GridView or other control

I have some additional attributes I want to add columns for, but I would like it to appear on a separate line as part of the same row sort of like this:

Is it possible to create a table with a multi-level row using ASP.NET GridView or other control

The reason I want to add these columns but have them appear on the second line of each row is that I want to display more data in each row but I don't want to make the row/page wider.

I did some googling for this problem, but I'm not even sure what the standard name for this type of display is so I wasn't able to come up with anything. The closest I found was [this code project link](http://www.codeproject.com/KB/webforms/MasterDetail.aspx ) which is close to, but not the开发者_如何学编程 same thing I am trying to do.


Not sure what to call it either (multiline gridview?) but it should be possible. I would suggest looking at making a grid with a template column and a formview inside the template. In the rowdatabound event of the grid you write code to bind your form to the row's data. I have used this technique before on nested grids, it should work with other controls as well. Might be simpler ways to do it too, not something I have had a need to work out before.

EDIT: I just saw a similar question where someone provided a link to this article. Not quite what we were talking about here, but very similar. Thought I would include it here as well for future reference. To bad it was written 5 months after this question was asked...

0

精彩评论

暂无评论...
验证码 换一张
取 消