<asp:TemplateField HeaderText="UserType" SortExpression="userType">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("userType") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("userType") %>'></asp:Label>
</EditItemTemplate>
先选datasource 旁边的小箭头然后找到edit columns, covert to the templatefield. usertype 不让改就把txtbox改成label