ASP.NET - 获取gridview的编辑行跨列跨越 [英] ASP.NET - Get gridview edit row to span across columns
问题描述
我有6列的网格控件。我用EditItemTemplate中要显示的字段编辑数据,我想如果可能的话定制的。眼下,EditItemTemplate中会显示我摆在那里,但它只是显示在其中的模板列中的任何控制权。我怎样才能得到它在所有6列跨越?例如,6列是:
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
和当用户点击编辑按钮(每行),我想显示这些6编辑,但低于一排,横跨所有6列添加1更多的控制权:
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?
推荐答案
您可以修改通过挂钩到 OnRowCreated
事件GridView控件。
You can modify the gridview control by hooking up to the OnRowCreated
event.
我发现了一个很COM prehensive教程此处的行和列在ASP.NET GridView控件合并
I found a very comprehensive tutorial here: Rows and Columns Merging in ASP.NET GridView Control
在发表的文章中,笔者以这样一个gridview:
In the posted article, the author takes a gridview like this:
和将其转换为这样的:
And transforms it to this:
这篇关于ASP.NET - 获取gridview的编辑行跨列跨越的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!