<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx</link><description>This post has been updated to work with the RTW version of the Silverlight 2 DataGrid .&amp;#160; The code examples are not guaranteed to work with previous Beta versions of the DataGrid. Read more about the features that the Silverlight 2 DataGrid has to</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8340818</link><pubDate>Fri, 28 Mar 2008 05:46:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8340818</guid><dc:creator>DM</dc:creator><description>&lt;p&gt;This might be a little off-topic...&lt;/p&gt;
&lt;p&gt;Does the Silverlight DataGrid supports group headers?&lt;/p&gt;
&lt;p&gt;i.e. a cell above a determined number of headers that spans the combined width of the headers it groups together. &amp;nbsp;When one of the headers in the group is resized, the group header follows and adapts itself to the new &amp;quot;combined width&amp;quot;.&lt;/p&gt;
&lt;p&gt;Thanks in advance!&lt;/p&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8341103</link><pubDate>Fri, 28 Mar 2008 08:51:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8341103</guid><dc:creator>Malky</dc:creator><description>&lt;p&gt;Hi Scott,&lt;/p&gt;
&lt;p&gt;Nice post you have here, I'am waiting for your next post using &amp;nbsp;&amp;quot;RowDetailsTemplate&amp;quot; , I am personally having difficulty to get reference control in &amp;lt;DataTemplate&amp;gt; under &amp;lt;RowDetailsTemplate&amp;gt; where I can use somewhere in my code&lt;/p&gt;
&lt;p&gt;Thanks for your attention&lt;/p&gt;
&lt;p&gt;- Malky&lt;/p&gt;
</description></item><item><title>March 28th Links: ASP.NET, ASP.NET AJAX, ASP.NET MVC, Visual Studio, Silverlight, .NET</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8341247</link><pubDate>Fri, 28 Mar 2008 11:43:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8341247</guid><dc:creator>Blogs</dc:creator><description>&lt;p&gt;Here is the latest in my link-listing series .&amp;amp;#160; Also check out my ASP.NET Tips, Tricks and Tutorials&lt;/p&gt;
</description></item><item><title>More Silverlight 2.0 DataGrid posts</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8343552</link><pubDate>Sat, 29 Mar 2008 18:48:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8343552</guid><dc:creator>Hot Topics</dc:creator><description>&lt;p&gt;Scott Guthrie lists a number of posts and videos about the Silverlight 2.0 DataGrid in March 28th Links&lt;/p&gt;
</description></item><item><title>Silverlight Cream for March 30, 2008 -- #240</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8345466</link><pubDate>Mon, 31 Mar 2008 14:20:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8345466</guid><dc:creator>Community Blogs</dc:creator><description>&lt;p&gt;Dan Wahlin&amp;amp;#39;s latest articles, Cheryl at Silverlight SDK on SL2, WS, and WCF, Sam Landstrom on using&lt;/p&gt;
</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8346496</link><pubDate>Tue, 01 Apr 2008 00:01:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8346496</guid><dc:creator>Jody.Breshears</dc:creator><description>&lt;p&gt;Very nice article. &amp;nbsp;However, it and nearly every other article or blog entry I have seen concerning the DataGrid, as well as ALL the documentation, assume that you will be constructing your grid in XAML. &amp;nbsp;My experience in the industry is that I am far more likely to need to create one dynamically. &amp;nbsp;Could you provide some examples of that? &amp;nbsp;&lt;/p&gt;
&lt;p&gt;I just finished importing your source code and altering it in order to solve a problem of mine, it was so bad. &amp;nbsp;I could sure use some examples.&lt;/p&gt;
&lt;p&gt; - Jody&lt;/p&gt;</description></item><item><title>Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8349898</link><pubDate>Wed, 02 Apr 2008 08:20:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8349898</guid><dc:creator>Defining Columns for a Silverlight DataGrid</dc:creator><description>&lt;p&gt;If you read my &amp;lt;a href=&amp;quot;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/s"&gt;http://blogs.msdn.com/s&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Silverlight Tips, Tricks, Tutorials and Links Page</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8350458</link><pubDate>Wed, 02 Apr 2008 12:03:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8350458</guid><dc:creator>ScottGu's Blog</dc:creator><description>&lt;p&gt;I'll be using this page to link to Silverlight 2 articles and posts (both ones I write as well ones by&lt;/p&gt;
</description></item><item><title>Defining Silverlight DataGrid Columns at Runtime</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8395121</link><pubDate>Tue, 15 Apr 2008 01:25:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8395121</guid><dc:creator>Scott Morrison</dc:creator><description>&lt;p&gt;Now that you know the basics of the Silverlight DataGrid and how to specify the Columns in XAML , you&lt;/p&gt;
</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8414899</link><pubDate>Mon, 21 Apr 2008 19:10:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8414899</guid><dc:creator>VinodK</dc:creator><description>&lt;p&gt;Great post/series. Thank you.&lt;/p&gt;
&lt;p&gt;Any thoughts on how I can conditionally format some columns, like positive numbers in green and negative numbers in red.&lt;/p&gt;
&lt;p&gt;Thanks again for great posts.&lt;/p&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8414954</link><pubDate>Mon, 21 Apr 2008 19:38:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8414954</guid><dc:creator>scmorris</dc:creator><description>&lt;p&gt;Hi Vinod,&lt;/p&gt;
&lt;p&gt;You can coditionally format the contents of your columns by using a converter. &amp;nbsp;To do this you would need to use a template column (for beta 1) since you cannot databind to properties on DataGridColumns just yet. &amp;nbsp;What you are going to want to do is databind the property you want to conditionally change, probably in your case either the Foreground or Background property, to the value with a converter that takes positive numbers and returns a green Brush, and negative numbers and returns a red Brush. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope this helps!&lt;/p&gt;
&lt;p&gt;-Scott&lt;/p&gt;
</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8415448</link><pubDate>Tue, 22 Apr 2008 00:28:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8415448</guid><dc:creator>VinodK</dc:creator><description>&lt;p&gt;Scott,&lt;/p&gt;
&lt;p&gt;It works great (data binding the property)&lt;/p&gt;
&lt;p&gt;Thanks for your help.&lt;/p&gt;
&lt;p&gt;- Vinod&lt;/p&gt;</description></item><item><title>silverlight 动态生成silverlight</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8525726</link><pubDate>Wed, 21 May 2008 04:19:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8525726</guid><dc:creator>星际</dc:creator><description>&lt;p&gt;NowthatyouknowthebasicsoftheSilverlightDataGridandhowtospecifytheColumnsinXAML,you...&lt;/p&gt;
</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8529083</link><pubDate>Wed, 21 May 2008 21:34:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8529083</guid><dc:creator>Kumar S</dc:creator><description>&lt;p&gt;Like many others, I jumped on to Silverlight 2.0 to create an internal application for my company. But, I couldn't produce an useful app since there is no Combobox control I can use in a DataGrid column. There are some examples in the web using Javascript or combining it with a textbox, button and listbox. I need a column in the Datagrid to have Combobox, like WinForm datagrid. It is disappointing hvaing the combobox control.&lt;/p&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8565322</link><pubDate>Sat, 31 May 2008 05:35:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8565322</guid><dc:creator>scmorris</dc:creator><description>&lt;p&gt;Hi Kumar,&lt;/p&gt;
&lt;p&gt;I can't comment on the status of a first party ComboBox, however if you are able to find a control that serves your purposes, you can create a ComboBox column using a template column. &amp;nbsp;If instead you want to pair up a ListBox, Button, PopUp, and TextBox you can do that as well since even though my sample above only has a single DatePicker in the template, you can use any DataTemplate as complicated as you want to define the contents of a cell.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;-Scott&lt;/p&gt;
</description></item><item><title>Silverlight DataGrid (2)</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8574724</link><pubDate>Thu, 05 Jun 2008 10:47:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8574724</guid><dc:creator>蓝色飞翔</dc:creator><description>&lt;p&gt;DefiningColumnsforaSilverlightDataGrid&lt;/p&gt;
</description></item><item><title>Silverlight DataGrid(1)</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8574727</link><pubDate>Thu, 05 Jun 2008 10:48:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8574727</guid><dc:creator>蓝色飞翔</dc:creator><description>&lt;p&gt;DefiningSilverlightDataGridColumnsatRuntime&lt;/p&gt;
&lt;p&gt;NowthatyouknowthebasicsoftheSilverlightD...&lt;/p&gt;
</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8579765</link><pubDate>Sat, 07 Jun 2008 11:53:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8579765</guid><dc:creator>Pawel</dc:creator><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;If i add some editable control to CellEditingTemplate (for example WatermarkedTextBox), after entering &amp;quot;Edit mode&amp;quot; focus is not on my editable control, and i have to click on this control to edit.&lt;/p&gt;
&lt;p&gt;Is there any solution to make editable control focused after entering cell in edit mode?&lt;/p&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8591100</link><pubDate>Wed, 11 Jun 2008 12:55:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8591100</guid><dc:creator>phil.d</dc:creator><description>&lt;P&gt;Hi Scott,&lt;/P&gt;
&lt;P&gt;Using the great reply you gave to Vinod, I've had a colour coded cell working in a datagrid using a converter returning one of six brushes when given a number (0 - 5). Worked/looked great in beta 1 but, having moved to beta 2 it's now failing during the page InitializeComponent LoadComponent with a method access exception on the converter module (called ColourAlerts) with System.MethodAccessException: &amp;nbsp;Tams.ColourAlerts..ctor() at System. Reflection. MethodBase. PerformSecurityCheck&lt;/P&gt;
&lt;P&gt;I've gone through the beta 2 datagrid breaking changes but can't see any relevant details on this. If you have any info' on why I'm getting this fault it &amp;nbsp;would be much appreciated.&lt;/P&gt;
&lt;P&gt;thanks, Phil&lt;/P&gt;</description></item><item><title>March 28th Links: ASP.NET, ASP.NET AJAX, ASP.NET MVC, Visual Studio, Silverlight, .NET</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8601207</link><pubDate>Sun, 15 Jun 2008 18:30:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8601207</guid><dc:creator>Readed By Wrocław NUG members</dc:creator><description>&lt;p&gt;Here is the latest in my link-listing series .&amp;amp;#160; Also check out my ASP.NET Tips, Tricks and Tutorials&lt;/p&gt;
</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8623655</link><pubDate>Fri, 20 Jun 2008 04:17:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8623655</guid><dc:creator>RMS81</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#180;m using this tutorial to create and populate a datagrid in silverlight beta 2, but when the grid is populated with the columns defined in the xaml file and with autogenerate columns set to false, I get all the rows but no values. If I don&amp;#180;t define de columns and set autogenerate columns to true everything works fine. Any ideia why this is happening?&lt;/p&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8625375</link><pubDate>Fri, 20 Jun 2008 17:04:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8625375</guid><dc:creator>paridhi</dc:creator><description>&lt;p&gt;how to change styles of column values at runtime depending upon some condition like one column which contains checkbox if checkbox is checked style of row should be changed &lt;/p&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8662183</link><pubDate>Fri, 27 Jun 2008 19:55:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8662183</guid><dc:creator>Two way binding and insert item</dc:creator><description>&lt;p&gt;Excellent post, I was not able to find how to setup the two way binding.&lt;/p&gt;
&lt;p&gt;One thing... if we add an element to the entity list associated, do we need to rebind the datasource? or the Datagrid is smart enough to detect the change and refresh the grid displayed?&lt;/p&gt;</description></item><item><title>StringFormat</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8687741</link><pubDate>Fri, 04 Jul 2008 10:21:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8687741</guid><dc:creator>Miguel Madero</dc:creator><description>&lt;p&gt;Scott, &lt;/p&gt;
&lt;p&gt;I can see how IValueConverter can be useful in certain escenarios, but most of the time using a FormString would be easier, in your example we could specify a formatString of &amp;quot;d&amp;quot;&lt;/p&gt;
&lt;p&gt;I dont know if there's something like that in SL or WPF. I did a trick to do something similar using ValueConverters, it work fine, but I think there should be a sexier solution. &lt;/p&gt;
&lt;p&gt;Here's the XAML. &lt;/p&gt;
&lt;p&gt; &amp;lt;UserControl.Resources&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;local:StringFormatConverter x:Name=&amp;quot;stringFormatter&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;/UserControl.Resources&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;StackPanel Orientation=&amp;quot;Vertical&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;StackPanel.DataContext&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;SilverlightApplication3:Person/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/StackPanel.DataContext&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;TextBlock HorizontalAlignment=&amp;quot;Left&amp;quot; VerticalAlignment=&amp;quot;Top&amp;quot; Text=&amp;quot;{Binding Mode=OneWay, Path=Name}&amp;quot; TextWrapping=&amp;quot;Wrap&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;TextBlock HorizontalAlignment=&amp;quot;Left&amp;quot; VerticalAlignment=&amp;quot;Top&amp;quot; Text=&amp;quot;{Binding Mode=OneWay, Path=LastName}&amp;quot; TextWrapping=&amp;quot;Wrap&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;TextBlock HorizontalAlignment=&amp;quot;Left&amp;quot; VerticalAlignment=&amp;quot;Top&amp;quot; Text='{Binding Mode=OneWay, Path=DOB, Converter={StaticResource stringFormatter}, ConverterParameter=&amp;quot;d&amp;quot;}' TextWrapping=&amp;quot;Wrap&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;TextBlock HorizontalAlignment=&amp;quot;Left&amp;quot; VerticalAlignment=&amp;quot;Top&amp;quot; Text='{Binding Mode=OneWay, Path=Age, Converter={StaticResource stringFormatter}, ConverterParameter=&amp;quot;c&amp;quot;}' TextWrapping=&amp;quot;Wrap&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;TextBlock HorizontalAlignment=&amp;quot;Left&amp;quot; VerticalAlignment=&amp;quot;Top&amp;quot; Text='{Binding Mode=OneWay, Path=AnualIncome, Converter={StaticResource stringFormatter}, ConverterParameter=&amp;quot;0.00&amp;quot;}' TextWrapping=&amp;quot;Wrap&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;/StackPanel&amp;gt;&lt;/p&gt;
&lt;p&gt;Here's de Code&lt;/p&gt;
&lt;p&gt; public class StringFormatConverter:IValueConverter&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;#region IValueConverter Members&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string formatString = parameter.ToString();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return String.Format(&amp;quot;{0:&amp;quot; + formatString + &amp;quot;}&amp;quot;, value);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;throw new InvalidOperationException(&amp;quot;This Convert supports only OneWay binding&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;#endregion&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#8954414</link><pubDate>Wed, 17 Sep 2008 00:14:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8954414</guid><dc:creator>Stanley</dc:creator><description>&lt;P&gt;Great post! Coming from WPF apps using ListView, I'm struggling with customizing the silverlight datagrid.&lt;/P&gt;
&lt;P&gt;One thing that I frequently use in WPF standalone app, and XBAP is the ValueConverter. In this case to give back an image path for showing an image in one of the columns in the datagrid. But when scrolling the datagrid the images are lost forever once they're scrolled out of view, not until the datagrid i refreshed again the images are shown. It seems the virtulization isn't working properly.&lt;/P&gt;
&lt;P&gt;I'm currently using VS2008sp1,FW 3.5SP1,Blend 2 June preview and downloaded the SilverLight 2.0 Beta 2 for VS.&lt;/P&gt;
&lt;P&gt;Any ideas?&lt;/P&gt;</description></item><item><title>Silverlight 2 DataGrid is Released</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#9000395</link><pubDate>Wed, 15 Oct 2008 09:46:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9000395</guid><dc:creator>Scott Morrison</dc:creator><description>&lt;p&gt;As you might have heard , we just released Silverlight 2 , and with it the first version of the Silverlight&lt;/p&gt;
</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#9013053</link><pubDate>Thu, 23 Oct 2008 17:17:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9013053</guid><dc:creator>Peter</dc:creator><description>&lt;P&gt;I am having a hard time with the DataGrid and its Template Column. The problem is that I don't know until runtime what property in my datasource to bind to because that is driven by some configuration data that I read up. I have no problem doing this with a DataGridTextColumn since that class offers a Binding property that I can set at runtime but I need to use the Template column since I want to provide a richer UI then just a text string. The Template column doesn't have the Binding property so I would need to specify my binding at design time in Xaml...and that is too early for me.&lt;/P&gt;
&lt;P&gt;The only way around this seems to have the datatemplate stored as a string, do some type of string substition of that string and then load it as a datatemplate. This doesn't sound like the best idea to me...I would like to keeep my datatemplate/styles in Xaml files so that they can be worked on by my designer in Blend.&lt;/P&gt;
&lt;P&gt;Is there any other direction that you could point me to? &lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Peter&lt;/P&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#9022927</link><pubDate>Wed, 29 Oct 2008 23:15:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9022927</guid><dc:creator>Paul Jenkins</dc:creator><description>&lt;P&gt;i'm having a devil of a time with the release version of Silverlight 2.0 defining my DataGrid header information (styling the header row so that it has a particular color/font/etc.) as well as the hover over row treatment and the selection treatment.&lt;/P&gt;
&lt;P&gt;do you have a definitive guide on how to change these key elements? &amp;nbsp;Should I shell into Blend and edit a control template there and play around or what??&lt;/P&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#9176384</link><pubDate>Thu, 04 Dec 2008 23:08:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9176384</guid><dc:creator>Scott Peterson</dc:creator><description>&lt;p&gt;When using a datagrid with AutoGenerateColums = true, I can individually check each box in each row as I would expect. &amp;nbsp;However, when I define a checkbox column manually, I can only select one row at a time.&lt;/p&gt;
&lt;p&gt;How do I resolve this? &amp;nbsp;I would like to be able to name my own columns. &amp;nbsp;Any help would be appreciated.&lt;/p&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#9222658</link><pubDate>Tue, 16 Dec 2008 01:37:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9222658</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;How can I create grid columns on the fly and bind them to a data source? &lt;/p&gt;</description></item><item><title>joins</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#9500789</link><pubDate>Mon, 23 Mar 2009 11:50:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9500789</guid><dc:creator>61231 - Julien Lemarié</dc:creator><description>&lt;p&gt;hi Scott&lt;/p&gt;
&lt;p&gt;If I want have in my datagrid, one information which is stored in an other table, who I can make that ?&lt;/p&gt;
&lt;p&gt;For example, I want display in the datagrid all my invoices with the name of client for each row.&lt;/p&gt;
&lt;p&gt;I need to create an object which contains the joint of 2 tables and binding the datagrid with this object ?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#9570537</link><pubDate>Mon, 27 Apr 2009 10:09:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9570537</guid><dc:creator>madhavi</dc:creator><description>&lt;p&gt;This artical is nice .&lt;/p&gt;
&lt;p&gt;I want that how to bind data from data base to grid using silver light is it possible.&lt;/p&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#9574877</link><pubDate>Wed, 29 Apr 2009 06:04:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9574877</guid><dc:creator>Bill</dc:creator><description>&lt;p&gt;How about creating a DataGridComboBoxColumn that inherits from DataGridBoundColumn.&lt;/p&gt;
&lt;p&gt;I need a combo box in a datagrid, and dont want to keep usuing the Column Template.&lt;/p&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#9627043</link><pubDate>Tue, 19 May 2009 09:20:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9627043</guid><dc:creator>ben</dc:creator><description>&lt;P&gt;hi, &lt;/P&gt;
&lt;P&gt;I have a problem, everytime i run my application two identical headers were display... Please check my code here... I had noticed that property method's name is also display in the datagrid. What I want is to display the image only dyanamically and remove the other column.&lt;/P&gt;
&lt;P&gt;Could anyone help me... Thanks in advance...&lt;/P&gt;
&lt;P&gt;In XAML..&lt;/P&gt;
&lt;P&gt;&amp;lt;my:DataGrid &amp;nbsp;x:Name="dataGrid" &amp;nbsp;Margin="80,88,104,116" &amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;my:DataGrid.Columns&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;my:DataGridTemplateColumn Header="Thumbnail"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;my:DataGridTemplateColumn.CellTemplate&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;DataTemplate&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Image Source="{Binding Thumbnail}" Width="64"/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/DataTemplate&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/my:DataGridTemplateColumn.CellTemplate&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/my:DataGridTemplateColumn&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/my:DataGrid.Columns&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/my:DataGrid&amp;gt;&lt;/P&gt;
&lt;P&gt;Propety page..&lt;/P&gt;
&lt;P&gt;Property Thumbnail() As String&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Get&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Return _image&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End Get&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Set(ByVal value As String)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_image = value&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End Set&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;End Property&lt;/P&gt;
&lt;P&gt;XAML.vb...&lt;/P&gt;
&lt;P&gt;source.Add(New TubeContent() With {.Thumbnail = imageURL})&lt;/P&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#9630386</link><pubDate>Wed, 20 May 2009 03:31:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9630386</guid><dc:creator>scmorris</dc:creator><description>&lt;p&gt;Hi Ben,&lt;/p&gt;
&lt;p&gt;The reason that you are seeing two columns is because the AutoGenerateColumns on your DataGrid is still true (this is the default value). &amp;nbsp;Setting it to false should fix your problem.&lt;/p&gt;
&lt;p&gt;Hope this helps!&lt;/p&gt;
</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#9630982</link><pubDate>Wed, 20 May 2009 05:51:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9630982</guid><dc:creator>Ben</dc:creator><description>&lt;p&gt;Hi scmorris,&lt;/p&gt;
&lt;p&gt;This is works! Thank You Very Much...&lt;/p&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#9841632</link><pubDate>Mon, 20 Jul 2009 17:11:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9841632</guid><dc:creator>Ganesh</dc:creator><description>&lt;p&gt;Hi, im new to silver light i have a got a basic doubt.&lt;/p&gt;
&lt;p&gt;I need to bind an array of items. which contains 5 attributes, and i need only 3 of them to be displayed in the grid. I did the follwoing&lt;/p&gt;
&lt;p&gt;&amp;lt;data:DataGrid.Columns&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;data:DataGridTextColumn Header=&amp;quot;Page&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Binding=&amp;quot;{Binding PageName}&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;data:DataGridTextColumn Header=&amp;quot;Data Item Caption&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Binding=&amp;quot;{Binding DisplayName}&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;data:DataGridTextColumn Header=&amp;quot;Message&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Binding=&amp;quot;{Binding Message}&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;data:DataGridTextColumn Header=&amp;quot;Item&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Binding=&amp;quot;{Binding Item}&amp;quot; &amp;nbsp;Visibility=&amp;quot;Collapsed&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;data:DataGridTextColumn Header=&amp;quot;Name&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Binding=&amp;quot;{Binding Name}&amp;quot; Visibility=&amp;quot;Collapsed&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/data:DataGrid.Columns&amp;gt;&lt;/p&gt;
&lt;p&gt;But in addition to these the other 5 attributes are also getting binded to the grid. How to make those five columns invisible.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#9841633</link><pubDate>Mon, 20 Jul 2009 17:13:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9841633</guid><dc:creator>Ganesh</dc:creator><description>&lt;p&gt;Hi i got the answer for my question. Thank u.&lt;/p&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#9844250</link><pubDate>Wed, 22 Jul 2009 05:45:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9844250</guid><dc:creator>Robert Fraser</dc:creator><description>&lt;p&gt;Hi scmorris,&lt;/p&gt;
&lt;p&gt;Since DataGridColumn properties aren't DependencyPropertys they can't be data-bound or whatever, right? So is there any way to bind the Width (or other) properties in XAML?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Robert&lt;/p&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#9856489</link><pubDate>Mon, 03 Aug 2009 23:21:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9856489</guid><dc:creator>scmorris</dc:creator><description>&lt;p&gt;Hi Robert,&lt;/p&gt;
&lt;p&gt;Unfortunately there is no way to databind properties on DataGridColumns yet. &amp;nbsp;This is since they are DependencyObjects instead of Controls, and DO's cannot be the target of a binding in Silverlight 3. &amp;nbsp;If the future when this functionality exists in the platform you can expect the DataGrid to fully support it.&lt;/p&gt;
&lt;p&gt;In the mean time, you will have to use programmatic methods to try to emulate the binding logic.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#9874005</link><pubDate>Tue, 18 Aug 2009 16:06:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9874005</guid><dc:creator>Majid MaghsudFar</dc:creator><description>&lt;p&gt;Hi Scott...&lt;/p&gt;
&lt;p&gt; Thanks, very much&lt;/p&gt;
&lt;p&gt; nice topic, it was very useful :)&lt;/p&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#9892218</link><pubDate>Mon, 07 Sep 2009 16:08:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9892218</guid><dc:creator>Divya Prakash</dc:creator><description>&lt;p&gt;can we transform row and column of the grid so that column appears in the top and row appears in the place of row&lt;/p&gt;</description></item><item><title>re: Defining Columns for a Silverlight DataGrid</title><link>http://blogs.msdn.com/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx#9924679</link><pubDate>Wed, 18 Nov 2009 20:46:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9924679</guid><dc:creator>bogdan71</dc:creator><description>&lt;p&gt;Scott,&lt;/p&gt;
&lt;p&gt;This is a great article.&lt;/p&gt;
&lt;p&gt;I would like to see if there is a way to create dynamic rows for silverlight datagrid?? &lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
</description></item></channel></rss>