<asp:TemplateField HeaderText="子机构编号"> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%#Eval("Org_ChildId").ToString().Length>8?Eval("Org_ChildId").ToString().Substring(0,8)+"...":Eval("Org_ChildId").ToString()%>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Org_ChildId") %>'></asp:TextBox> </EditItemTemplate> </asp:TemplateField>