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

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
J
Java Code Geeks
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
A
About on SuperTechFans
腾讯CDC
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Microsoft Azure Blog
Microsoft Azure Blog
D
Docker
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog
F
Fortinet All Blogs
I
InfoQ
博客园 - 【当耐特】
美团技术团队
GbyAI
GbyAI
量子位
宝玉的分享
宝玉的分享
爱范儿
爱范儿
有赞技术团队
有赞技术团队
博客园 - Franky
L
LangChain Blog
阮一峰的网络日志
阮一峰的网络日志

博客园 - 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);