在GridView中,設置字符超出單元格部分的內容用“...”表示,代碼如下:
<asp:TemplateField HeaderText="用途" SortExpression="USE_FOR">
<ItemTemplate> <div style="width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none" title='<%# Eval("USE_FOR")%>'> <asp:Label ID="lblUSE_FOR" runat="server" Text='<%# Bind("USE_FOR")%>'></asp:Label> </div> </ItemTemplate> </asp:TemplateField> |
|