选择gridview上的按钮 - asp.net

时间:2011-07-08 13:17:16

标签: asp.net

在asp.net中,当你在gridview上有一个自动生成的选择按钮时,是否可以将它的文本从“选择”更改为你选择的其他内容?如果是这样,有人能指出我的一个例子吗?

再次感谢

2 个答案:

答案 0 :(得分:5)

检查这个类似的问题:

Changing text of an autogenerated select column of a gridview in asp.net - How?

示例:

<asp:buttonfield buttontype="Button" 
                 commandname="Select"
                 headertext="Select Customer" 
                 text="SelectText"/>

答案 1 :(得分:-1)

<asp:GridView ID="gvSearch" runat="server" Visible="False" 
                OnPageIndexChanging="Grid_Changing" AllowPaging="True" AllowSorting="True" 
                AutoGenerateSelectButton="True" CellPadding="4" Font-Names="Arial" 
                Font-Size="XX-Small" ForeColor="#333333" GridLines="None" 
                onselectedindexchanged="gvSearch_SelectedIndexChanged" PageSize="100">
                <AlternatingRowStyle BackColor="White" />
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>