简体   繁体   English

显示datagridview的水平条以溢出单元格内容

[英]Showing horizontal bar for datagridview for overflowing cell content

在此处输入图片说明

My datagridview abbreviates the rest of the string when the cell is too small to contain the string. 当单元太小而无法包含字符串时,我的datagridview会缩写字符串的其余部分。

How do I make it so that a horizontal scrollbar is shown so that the content can be viewed? 如何使其显示水平滚动条以便可以查看内容?

The datagridview is docked (fill) to the form and has a single column header with fill property as well. datagridview停靠(填充)到表单,并且具有带有fill属性的单个列标题。

<asp:TemplateField HeaderText="Body">
<ItemTemplate>
 <div style="overflow:auto; height: 100px;">
  <asp:Label ID="Label1" runat="server" Text='<%# Bind("Body")%>'></asp:Label>
 </div>
</ItemTemplate>
</asp:TemplateField>

Use in this way in your gridview inorder to set the overflowing data. 在gridview中以这种方式使用以便设置溢出数据。 This shows the scrollbars. 这显示了滚动条。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM