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

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
CERT Recently Published Vulnerability Notes
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed
Security Latest
Security Latest
P
Privacy International News Feed
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
AI
AI
Cisco Talos Blog
Cisco Talos Blog
K
Kaspersky official blog
S
Secure Thoughts
PCI Perspectives
PCI Perspectives
Simon Willison's Weblog
Simon Willison's Weblog
D
DataBreaches.Net
GbyAI
GbyAI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
罗磊的独立博客
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
V
V2EX
Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Tenable Blog
T
Threat Research - Cisco Blogs
T
Troy Hunt's Blog
V2EX - 技术
V2EX - 技术
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
L
Lohrmann on Cybersecurity
F
Full Disclosure
H
Help Net Security
博客园 - Franky
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
Engineering at Meta
Engineering at Meta
A
Arctic Wolf
O
OpenAI News
S
Securelist

博客园 - 小强小工

WinForm窗体生命周期 Oracle格式化函数 ORACLE时间间隔函数 浅谈数据库设计技巧(转) Oracle与SQLServer返回datatable列名大小写 oracle、sqlserver数据库排序空值null问题解决办法 MS SQL Server中的CONVERT日期格式化大全 .NET开发资源站点和.NET开源项目收集 C#中ToString格式大全 - 小强小工 - 博客园 oracle 事务 相关 Oracle SGA 各种排序方法的综合比较 .NET中三种数据类型转换的区别:(type), type.Parse, Convert类 从追MM谈Java的23种设计模式 WinCE概念扫盲 将WinCE5.0模拟器连接到VS2005 .net的事件与委托(转载) VB有关handles 的问题 VB中的handles在C#中怎么写?
DataGrid设置中文列名
小强小工 · 2009-12-16 · via 博客园 - 小强小工

代码

 public void SetGridStyle(DataGrid grid,string TableName)
        {
            
if (grid == nullreturn;
            DataGridTableStyle gridStyle 
= new DataGridTableStyle();
            gridStyle.MappingName 
= TableName;  //必需

            AddGridStyle(

"Style""款号"ref gridStyle, 70); 
            AddGridStyle(
"Descr_C""名称"ref gridStyle, 50);
            AddGridStyle(
"Color""颜色"ref gridStyle, 40);
            AddGridStyle(
"Size""尺码"ref gridStyle, 40);
            AddGridStyle(
"PutawayQty""数量"ref gridStyle, 40);

            grid.TableStyles.Clear();
            grid.TableStyles.Add(gridStyle);
          
        }

//添加单个样式
        private void AddGridStyle(string MappingName, string HeaderText, ref DataGridTableStyle gridStyle, int colWidth)
        {
            DataGridTextBoxColumn col 
= new DataGridTextBoxColumn();
            col.MappingName 
= MappingName;
            col.HeaderText 
= HeaderText;
            col.NullText 
= "";
            col.Width 
= colWidth;
            gridStyle.GridColumnStyles.Add(col);
        }