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

推荐订阅源

C
Check Point Blog
S
Schneier on Security
P
Privacy & Cybersecurity Law Blog
S
Security @ Cisco Blogs
W
WeLiveSecurity
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Microsoft Azure Blog
Microsoft Azure Blog
NISL@THU
NISL@THU
T
Troy Hunt's Blog
L
LangChain Blog
L
LINUX DO - 最新话题
T
The Exploit Database - CXSecurity.com
Engineering at Meta
Engineering at Meta
N
News and Events Feed by Topic
A
About on SuperTechFans
N
Netflix TechBlog - Medium
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
Martin Fowler
Martin Fowler
Y
Y Combinator Blog
H
Heimdal Security Blog
aimingoo的专栏
aimingoo的专栏
T
Threat Research - Cisco Blogs
SecWiki News
SecWiki News
Microsoft Security Blog
Microsoft Security Blog
T
Tenable Blog
P
Proofpoint News Feed
H
Hacker News: Front Page
G
GRAHAM CLULEY
I
Intezer
V
V2EX
S
Secure Thoughts
Stack Overflow Blog
Stack Overflow Blog
H
Help Net Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
Latest news
Latest news
Recent Announcements
Recent Announcements
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
博客园_首页
Webroot Blog
Webroot Blog
博客园 - 三生石上(FineUI控件)
AI
AI
N
News | PayPal Newsroom
Google DeepMind News
Google DeepMind News
Security Archives - TechRepublic
Security Archives - TechRepublic
B
Blog RSS Feed
美团技术团队

博客园 - InFuture

变成百万富翁的二十五种方法 今天终于测试解决了WCF传递大数据量的问题 关于工作流设计方面的一些经验总结 Telnet客户端 字符串表达式求值(转) 关于事件处理的完整框架Event,delegate,event args,无图有真相。 关于树形结构父类查子类,子类查父类的方法 最近准备整理一下手头资料,开发一个工作流和表单管理系统 今天装好了window 7 Silverlight 客户端如何访问WCF 如何让用户控件占满全部页面,silverlight用户控件开发问题 wpf 数据绑定有关讲解 ASP.NET 3.5 Extensions: Dynamic Data Web Site 要點整理(转载) 免费的微软OneCare防病毒软件 Visual Studio 2008 SP1: EntityDataSource Where Clause(转载) Visual Studio 2008 SP1: EntityDataSource for ASP.Net (转载) 今天装了VS2008 Sp1!真是非常激动!(VS2008 sp1下载地址) ASP.NET里的支架:Dynamic Data Support(转载) VS2008的黑色皮肤
silverlight DataGrid模板列的动态生成
InFuture · 2011-06-20 · via 博客园 - InFuture

     string strXaml = @" <DataTemplate xmlns='http://schemas.microsoft.com/client/2007'>
            <Grid HorizontalAlignment='Center' VerticalAlignment='Center'>
                <Grid.RowDefinitions>
                    <RowDefinition Height='35'></RowDefinition>
                    <RowDefinition Height='35'></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width='150'></ColumnDefinition>
                    <ColumnDefinition Width='150'></ColumnDefinition>
                </Grid.ColumnDefinitions>
                    <TextBlock Text='Col1'></TextBlock>
                    <TextBlock Text='Col2' Grid.Column='1'></TextBlock>
                {0}
            </Grid>
                </DataTemplate>";


            StringBuilder sb = new StringBuilder();
            int k = 0;
            foreach (var item in this.objTableCaseTemplate.lstDBCaseItemTemplate)
            {
                if (k >= 2) break;
                string tbn = "DB_" + item.PhyTbName;
                string s = item.ItemName;
                sb.AppendLine("<TextBox Text='{Binding Path=" + tbn + "." + s + ",Mode=TwoWay }' Grid.Column='" + k + "' Grid.Row='1'/>");
                k++;
            }

            strXaml = string.Format(strXaml, sb.ToString());

            DataTemplate dtTemplate = (DataTemplate)XamlReader.Load(strXaml);

            DataGridTemplateColumn tmpCol = new DataGridTemplateColumn();
            tmpCol.Header = "某个组";
            tmpCol.CellTemplate = dtTemplate;
            this.dataGridCaseList.Columns.Add(tmpCol);