使用asp.net在网格视图控件断行
it1352
帮助1人
问题说明
我想将该行分成多个子行.
例如:我有这样的行
世界,你好吗?
我需要以下输出
世界您好
I want to break the row in to multiple sub row.
For example : I have a row like this
Hello world how r u.
i need the output as below
Hello world
how r u..
正确答案
#1
如果要包装句子,则可以添加< br>无论您想打破同一个地方
在您的情况下,就像
你好,世界< br>
你怎么样.
-Amol
If you want to wrap the sentence then you can add a <br> wherever you want to break the same
In your case it will be like
Hello world <br>
how r u..
-Amol
在内容中使用<br />
标记
use <br />
Tag in your content
Row1<br />Row2<br />Row3
它会显示如下所示的输出
第1行
行2
行3
顺便说一句,您可以使用ItemStyle-Wrap="true"
包装内容
It''ll show you output like below
Row1
Row2
Row3
BTW you can wrap the content by using ItemStyle-Wrap="true"
<asp:gridview runat="server" xmlns:asp="#unknown">
<columns>
<asp:boundfield itemstyle-wrap="true" datafield="Column1" />
</columns>
</asp:gridview>
选项1:为该列设置适当"的宽度,并将wrap属性设置为true.这两个属性都可以在GridView
的ItemStyle
中找到.
选项2:在RowDataBound
事件中,检查该列,然后更改文本以在所需的单词数之后添加\n
.请记住将列的wrap属性设置为true.
希望这会有所帮助!
Option 1: Set "appropriate" width for that column and set the wrap property to true. Both the properties can be found inItemStyle
of theGridView
.
Option 2: In theRowDataBound
event, check for that column, and change the text to add\n
after the number of words you want. Do remember to set the wrap property of the column to true.
Hope this helps!
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /reply/detail/tanhcgkeek
系列文章
更多
同类精品
更多
-
YouTube API 不能在 iOS (iPhone/iPad) 工作,但在桌面浏览器工作正常?
it1352 07-30 -
保持在后台运行的 iPhone 应用程序完全可操作
it1352 07-25 -
iPhone,一张图像叠加到另一张图像上以创建要保存的新图像?(水印)
it1352 07-17 -
使用 iPhone 进行移动设备管理
it1352 07-23 -
在android同时打开手电筒和前置摄像头
it1352 09-28 -
扫描 NFC 标签时是否可以启动应用程序?
it1352 08-02 -
检查邮件是否发送成功
it1352 07-25 -
Android微调工具-删除当前选择
it1352 06-20 -
希伯来语的空格句子标记化错误
it1352 06-22 -
复制文件夹/文件而不修改属性?
it1352 07-15