我真的是新手,但是当我在设计器中定义列时,有人可以告诉我如何在 GridView 中添加值。我有一列 type Buttonfield
。我的 default.asax 代码如下。
代码:
<asp:GridView ID="gvTableHolding" runat="server" BackColor="White"
BorderColor="#CCCCCC" BorderWidth="1px" CellPadding="3" Width="1184px"
BorderStyle="None" CssClass="DDGridView"
onrowcommand="gvTableHolding_RowCommand" ShowHeaderWhenEmpty="True"
EmptyDataText=" No Data!" ViewStateMode="Enabled">
<Columns>
<asp:BoundField HeaderText="Holding Register " />
<asp:BoundField HeaderText="Description" />
<asp:BoundField HeaderText="Set Value" />
<asp:ButtonField ButtonType="Button" ShowHeader="True" Text="ChangeValue"
CommandName="ChangeValue" HeaderText="Buttons" />
<asp:BoundField HeaderText="Default Value" />
<asp:BoundField HeaderText="Decimal" />
<asp:BoundField HeaderText="Hex" />
</Columns>
<FooterStyle BackColor="White" ForeColor="#000066" />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="White" ForeColor="#000066"
HorizontalAlign="Left" />
<RowStyle ForeColor="#000066" HorizontalAlign="Center"/>
<SelectedRowStyle BackColor="#669999" ForeColor="White" Font-Bold="True" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#007DBB" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#00547E" />
</asp:GridView>
先感谢您!