我正在尝试在旧版ASP.NET应用程序的DataGrid中的每一行添加几个按钮。
代码如下:
<asp:datagrid id="dgView" style="Z-INDEX: 101; LEFT: 0px; POSITION: absolute; TOP: 0px" runat="server" Width="100%" BorderColor="Black" AllowPaging="True" PageSize="8">
<AlternatingItemStyle Font-Size="XX-Small" Font-Names="Verdana" HorizontalAlign="Center" VerticalAlign="Bottom">
</AlternatingItemStyle>
<ItemStyle Font-Size="XX-Small" Font-Names="Verdana" Wrap="False" HorizontalAlign="Center" Height="20px" ForeColor="Black" VerticalAlign="Bottom" BackColor="White"></ItemStyle>
<HeaderStyle Font-Size="X-Small" Font-Names="Verdana" Font-Bold="True" HorizontalAlign="Center" Height="20px" ForeColor="#990033" VerticalAlign="Middle" BackColor="LightGray"></HeaderStyle>
<PagerStyle Height="20px" Mode="NumericPages"></PagerStyle>
<Columns>
<asp:ButtonColumn ButtonType="PushButton" Text="Reprocess" CommandName="Reprocess">
<ItemStyle Font-Size="XX-Small" Font-Bold="True" ForeColor="Blue"></ItemStyle>
</asp:ButtonColumn>
<asp:ButtonColumn ButtonType="PushButton" Text="Suppress" CommandName="Suppress">
<ItemStyle Font-Size="XX-Small" Font-Bold="True" ForeColor="Blue"></ItemStyle>
</asp:ButtonColumn>
</Columns>
</asp:datagrid>
下面是生成的网格:
alt text http://img255.imageshack.us/img255/3442/gridview.png
其余的列来自数据绑定记录集。我不想在这上面花费任何时间,除了添加这个按钮所需要的时间之外,我只得到一天左右的时间来添加一些功能,然后我就必须继续。当我取下“抑制”按钮时,“再处理”按钮将变为可见,但似乎一次只能看到一个。问题可能是什么?