惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
S
Securelist
MyScale Blog
MyScale Blog
Jina AI
Jina AI
罗磊的独立博客
The Cloudflare Blog
美团技术团队
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
雷峰网
雷峰网
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
博客园 - 聂微东
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MongoDB | Blog
MongoDB | Blog
T
Tailwind CSS Blog
Attack and Defense Labs
Attack and Defense Labs
博客园_首页
Latest news
Latest news
Apple Machine Learning Research
Apple Machine Learning Research
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Hacker News
The Hacker News
G
GRAHAM CLULEY
Simon Willison's Weblog
Simon Willison's Weblog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
U
Unit 42
D
Docker
Webroot Blog
Webroot Blog
N
Netflix TechBlog - Medium
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 最新话题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
B
Blog
Recent Announcements
Recent Announcements
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
Security Latest
Security Latest
V2EX - 技术
V2EX - 技术
N
News | PayPal Newsroom
Microsoft Security Blog
Microsoft Security Blog

博客园 - 白水书生

招聘.net开发工程师(1人) 有效期2005年7月底 无法在web服务器上启动调试 HTTP/1.0 503 FlexCell表格控件For .NET V1.0.6 BLOG集锦 Mobile P 4和Mobile P4 M 奥运开始了!!!!! SQL Server的系统表 解决编写导入dBase存储过程的遇到的问题 项目实施有感 问题多多!!盼高手啊!!! 今天遇到一个奇怪的问题!!无奈搞了半天也没解决,难道非要重装 周日加班!无奈中就自己炫耀一下!!! 都是IE 缓存惹的祸!! 2004年度北京八大手机集散地大巡礼 Reporting Services 出书了!!! 解决报表部署时数据源存在不能替换的问题 [转]北京好吃地点大全 2004年5月版 如何知道自己的计算机是否安装了.Net Framework 1.1
控制DataGrid里的内容换行与不换行 - 白水书生 - 博客园
白水书生 · 2004-08-18 · via 博客园 - 白水书生

//换行
DataGrid1.Attributes.Add("style","word-break:keep-all;word-wrap:normal");
当内容为数字 ,则必须
void DataGrid1_DataBound(Object sender, DataGridItemEventArgs e)
{
  if( e.Item.ItemType == ListItemType.Item ||
    e.Item.ItemType == ListItemType.AlternatingItem)
   e.Item.Cells[1].Text = "<nobr>" + e.Item.Cells[1].Text + "</nobr>";
}

或者
private void DataGrid1_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
  {
   if(e.Item.ItemType ==ListItemType.Header||e.Item .ItemType==ListItemType.Item ||e.Item .ItemType ==ListItemType.AlternatingItem)
   {
    for(int i=0;i<e.Item .Cells .Count ;i++)
    {
     e.Item .Cells [i].Attributes .Add ("nowrap","nowrap");
    }
   }
  }
 
//自动换行
DataGrid1.Attributes.Add("style","word-break:break-all;word-wrap:break-word");