我想将命令字段名称从“select”更改为“查看详细信息”。如何更改命令字段文本名称。我想让列显示记录的详细信息。如何重命名命令字段的列标题和数据文本字段
<asp:GridView runat="server" ID="GvLeads" AutoGenerateColumns="False" >
<Columns>
<asp:BoundField HeaderText="Id" DataField="LeadId" />
<asp:BoundField HeaderText="Company" DataField="Companyname" />
<asp:BoundField HeaderText="Contact Person" DataField="ContactPerson" />
<asp:CommandField HeaderText="View" ShowSelectButton="true" />
</Coloumns>
</asp:GridView>
答案 0 :(得分:0)
您可以使用SelectText这样的属性: -
<asp:CommandField HeaderText="View" ShowSelectButton="true" selecttext="view details" />
答案 1 :(得分:0)
然后使用SelectText属性!
<asp:GridView runat="server" ID="GvLeads" AutoGenerateColumns="False" >
<Columns>
<asp:BoundField HeaderText="Id" DataField="LeadId" />
<asp:BoundField HeaderText="Company" DataField="Companyname" /> <asp:BoundField HeaderText="Contact Person" DataField="ContactPerson" />
<asp:CommandField SelectText="View Details" HeaderText="View" ShowSelectButton="true" />
</Coloumns>
</asp:GridView>