【发布时间】:2013-05-30 14:55:58
【问题描述】:
所以我用谷歌搜索过stackoverflow,现在我的大脑已经超负荷了。我是 asp.net 的新手,但要掌握它的窍门。
我目前的要求是有一个网格视图,在加载时,所有行的 1 列都会立即进入编辑模式。我用这个问题和代码让我继续前进:
Allowing one column to be edited but not another
<asp:gridview id="CustomersGridView"
datasourceid="CustomersSqlDataSource"
autogeneratecolumns="false"
autogenerateeditbutton="true"
allowpaging="true"
datakeynames="CustomerID"
runat="server">
<columns>
<asp:boundfield datafield="CustomerID" readonly="true" headertext="Customer ID"/>
<asp:boundfield datafield="CompanyName" readonly="true" headertext="Customer Name"/>
<asp:boundfield datafield="Address" headertext="Address"/>
<asp:boundfield datafield="City" headertext="City"/>
<asp:boundfield datafield="PostalCode" headertext="ZIP Code"/>
</columns>
</asp:gridview>
我已经搜索并找到了一些好的解决方案,但是,我并不完全理解它们,并且未能成功实施它们。它们是:
Edit/Update a single GridView field
Put multiple rows of a gridview into edit mode
所以我的问题是,如何将列(例如邮政编码)同时置于所有行的编辑模式?
感谢所有帮助!
谢谢!
斯蒂芬
【问题讨论】: