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

推荐订阅源

H
Hacker News: Front Page
博客园_首页
大猫的无限游戏
大猫的无限游戏
有赞技术团队
有赞技术团队
Microsoft Azure Blog
Microsoft Azure Blog
Recorded Future
Recorded Future
博客园 - Franky
Application and Cybersecurity Blog
Application and Cybersecurity Blog
U
Unit 42
S
Secure Thoughts
博客园 - 司徒正美
美团技术团队
C
Cisco Blogs
The GitHub Blog
The GitHub Blog
G
Google Developers Blog
V
Vulnerabilities – Threatpost
T
Troy Hunt's Blog
S
Security Affairs
爱范儿
爱范儿
AWS News Blog
AWS News Blog
Help Net Security
Help Net Security
Blog — PlanetScale
Blog — PlanetScale
T
Threatpost
F
Fortinet All Blogs
Scott Helme
Scott Helme
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog RSS Feed
O
OpenAI News
S
Schneier on Security
Stack Overflow Blog
Stack Overflow Blog
T
Tor Project blog
AI
AI
D
DataBreaches.Net
PCI Perspectives
PCI Perspectives
T
Tailwind CSS Blog
Martin Fowler
Martin Fowler
P
Palo Alto Networks Blog
C
CERT Recently Published Vulnerability Notes
腾讯CDC
T
Tenable Blog
人人都是产品经理
人人都是产品经理
Recent Announcements
Recent Announcements
C
Cyber Attacks, Cyber Crime and Cyber Security
Jina AI
Jina AI
Hacker News - Newest:
Hacker News - Newest: "LLM"
Google Online Security Blog
Google Online Security Blog
S
Securelist
P
Proofpoint News Feed
L
LINUX DO - 最新话题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

博客园 - 一个春天

用ASP.NET 2.0实现AJAX风格的Web开发 Web2.0时代,RSS你会用了吗? web2.0开源代码 Web 2.0 编程思想:16条法则 Web2.0简介 解读Web 2.0流行词 什么是RSS? Web 2.0学习指南 什么是Web 2.0 biztalk中调用.NET类 C#创建快捷方式 获得Windows中系统特殊文件夹的位置 ADO.NET中连接池状态的跟踪 NET Framework的安装 DataGrid常见问题 User Control事件无法触发? ASP.NET中动态创建DataGrid的模板列 Dispose模式 关于ASP.NET程序的发布
DataGrid列宽度设置
一个春天 · 2004-05-22 · via 博客园 - 一个春天

浏览状态下的列宽度可以这样设置:
Column.ItemStyle.Width = 100;

编辑状态下的列宽度可以这样设置:

private void DataGrid1_EditCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
    DataGridItem line = dbgCustomers.Items[e.Item.ItemIndex];
    TextBox tb1 = (TextBox)line.Cells[0].Controls[0];
    TextBox tb2 = (TextBox)line.Cells[1].Controls[0];

    tb1.Width = Unit.Percentage(100);
    tb2.Width = Unit.Percentage(100);
    tb2.TextMode = TextBoxMode.MultiLine;
}


参见:
http://msmvps.com/montaque/posts/5353.aspx

posted on 2004-05-22 12:55  一个春天  阅读(3194)  评论(0)    收藏  举报