页面代码
<asp:TemplateField HeaderText="预订出库ID" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
<ItemTemplate>
<div class="tooltip" style="width: 100px">
<asp:Label ID="LblPreOutId" runat="server" Text='<%# Eval("product_out_id")%>' ToolTip='<%# Eval("product_out_id")%>'></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
样式
.tooltip {
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
text-align:center;
table-layout:fixed;
}
本文介绍了一个 ASP.NET GridView 控件中定制显示预订出库ID字段的方法。通过使用 TemplateField 和 Label 控件结合服务器端代码,实现了对特定字段的格式化展示,并添加了工具提示以增强用户体验。
3121

被折叠的 条评论
为什么被折叠?



