﻿<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://developers.de/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>Accessing of Rows in Silverlight DataGrid</title><link />http://developers.de/blogs/damir_dobric/archive/2010/05/02/accessing-of-rows-in-silverlight-datagrid.aspx<description>Imagine you want to enumerate (enlist) all rows (DataGridRow) of Silverlight Grid (DataGrid). By design this is not very simple tasks. For example, you want to do something like this: &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;</description><dc:language>en</dc:language><generator>CommunityServer 2008 SP1 (Build: 30619.63)</generator><item><title>re: Accessing of Rows in Silverlight DataGrid</title><link />http://developers.de/blogs/damir_dobric/archive/2010/05/02/accessing-of-rows-in-silverlight-datagrid.aspx#312760<pubdate>Fri, 15 Jun 2012 19:27:52 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:312760</guid><dc:creator>Marco</dc:creator><description>&lt;p&gt;Very good! Thank you very much!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=312760" width="1" height="1"&gt;</description></item><item><title>re: Accessing of Rows in Silverlight DataGrid</title><link />http://developers.de/blogs/damir_dobric/archive/2010/05/02/accessing-of-rows-in-silverlight-datagrid.aspx#303103<pubdate>Fri, 27 Apr 2012 18:07:50 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:303103</guid><dc:creator>kc</dc:creator><description>&lt;p&gt;To get m_Grid.Columns.Last() to work add using System.Linq; to the usings&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=303103" width="1" height="1"&gt;</description></item><item><title>re: Accessing of Rows in Silverlight DataGrid</title><link />http://developers.de/blogs/damir_dobric/archive/2010/05/02/accessing-of-rows-in-silverlight-datagrid.aspx#275739<pubdate>Tue, 13 Mar 2012 11:40:17 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:275739</guid><dc:creator>ali</dc:creator><description>&lt;p&gt;using System.Windows.Controls.Primitives&lt;/p&gt;
&lt;p&gt;var rowsPeresentor = myGrid.GetVisualDescendants().OfType&amp;lt;DataGridRowsPresenter&amp;gt;().FirstOrDefault();&lt;/p&gt;
&lt;p&gt;			var Rows = rowsPeresentor.GetVisualDescendants().OfType&amp;lt;DataGridRow&amp;gt;();&lt;/p&gt;
&lt;p&gt;			foreach (var row in Rows)&lt;/p&gt;
&lt;p&gt;			{&lt;/p&gt;
&lt;p&gt;				if (row.GetIndex() == myGrid.SelectedIndex)&lt;/p&gt;
&lt;p&gt;				{&lt;/p&gt;
&lt;p&gt;					//your code&lt;/p&gt;
&lt;p&gt;					break;&lt;/p&gt;
&lt;p&gt;				}&lt;/p&gt;
&lt;p&gt;			}&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=275739" width="1" height="1"&gt;</description></item><item><title>re: Accessing of Rows in Silverlight DataGrid</title><link />http://developers.de/blogs/damir_dobric/archive/2010/05/02/accessing-of-rows-in-silverlight-datagrid.aspx#221062<pubdate>Thu, 24 Nov 2011 00:11:19 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:221062</guid><dc:creator>Salvador</dc:creator><description>&lt;p&gt; I got an error on the following line&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;private IEnumerator m_Enumerator; &lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;quot;IEnumerator&amp;quot; requires one type argument&lt;/p&gt;
&lt;p&gt;beauXjames:&lt;/p&gt;
&lt;p&gt;do you have thesample wher you aplied the code? &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=221062" width="1" height="1"&gt;</description></item><item><title>re: Accessing of Rows in Silverlight DataGrid</title><link />http://developers.de/blogs/damir_dobric/archive/2010/05/02/accessing-of-rows-in-silverlight-datagrid.aspx#221066<pubdate>Fri, 18 Nov 2011 11:37:04 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:221066</guid><dc:creator>vova</dc:creator><description>&lt;p&gt;if you use ScrollViewer, it could be simpler&lt;/p&gt;
&lt;p&gt;dataGrid.UpdateLayout();&lt;/p&gt;
&lt;p&gt;Pager.PageSize = 50; //just as many as cause scroll bar to be visible&lt;/p&gt;
&lt;p&gt;dataGrid.UpdateLayout();&lt;/p&gt;
&lt;p&gt;Pager.PageSize = (int)((ScrollViewer.ActualHeight / row.ActualHeight) - 1);&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=221066" width="1" height="1"&gt;</description></item><item><title>re: Accessing of Rows in Silverlight DataGrid</title><link />http://developers.de/blogs/damir_dobric/archive/2010/05/02/accessing-of-rows-in-silverlight-datagrid.aspx#191867<pubdate>Tue, 16 Aug 2011 16:30:48 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:191867</guid><dc:creator>tomW</dc:creator><description>&lt;p&gt;Columns.Last())&lt;/p&gt;
&lt;p&gt;Columns dose not have Last() mothed?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=191867" width="1" height="1"&gt;</description></item><item><title>re: Accessing of Rows in Silverlight DataGrid</title><link />http://developers.de/blogs/damir_dobric/archive/2010/05/02/accessing-of-rows-in-silverlight-datagrid.aspx#191869<pubdate>Fri, 12 Aug 2011 16:12:18 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:191869</guid><dc:creator>tw</dc:creator><description>&lt;p&gt;About grid.Columns.Last() error,&lt;/p&gt;
&lt;p&gt;It dose not contain definittion for &amp;quot;Last()&amp;quot;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=191869" width="1" height="1"&gt;</description></item><item><title>re: Accessing of Rows in Silverlight DataGrid</title><link />http://developers.de/blogs/damir_dobric/archive/2010/05/02/accessing-of-rows-in-silverlight-datagrid.aspx#191872<pubdate>Thu, 04 Aug 2011 23:45:01 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:191872</guid><dc:creator>Raman</dc:creator><description>&lt;p&gt;Can we expect a complete code for this sample? It will be very helpfull.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=191872" width="1" height="1"&gt;</description></item><item><title>re: Accessing of Rows in Silverlight DataGrid</title><link />http://developers.de/blogs/damir_dobric/archive/2010/05/02/accessing-of-rows-in-silverlight-datagrid.aspx#46896<pubdate>Fri, 20 May 2011 09:46:47 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:46896</guid><dc:creator>Mohak Mahato</dc:creator><description>&lt;p&gt;COOL&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=46896" width="1" height="1"&gt;</description></item><item><title>re: Accessing of Rows in Silverlight DataGrid</title><link />http://developers.de/blogs/damir_dobric/archive/2010/05/02/accessing-of-rows-in-silverlight-datagrid.aspx#36142<pubdate>Fri, 11 Mar 2011 00:36:33 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:36142</guid><dc:creator>fjg</dc:creator><description>&lt;p&gt;Just I need&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=36142" width="1" height="1"&gt;</description></item><item><title>How to register Button ClickHandler of button in DataGrid in TemplateControl</title><link />http://developers.de/blogs/damir_dobric/archive/2010/05/02/accessing-of-rows-in-silverlight-datagrid.aspx#221094<pubdate>Thu, 03 Feb 2011 22:58:51 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:221094</guid><dc:creator>Damir Dobric Posts</dc:creator><description>&lt;p&gt;Registering of Click event of a button contained in the datatemplate of datagrid which is contained in&lt;/p&gt;
&lt;img src="http://developers.de/aggbug.aspx?PostID=221094" width="1" height="1"&gt;</description></item><item><title>How to register Button ClickHandler of button in DataGrid in TemplateControl</title><link />http://developers.de/blogs/damir_dobric/archive/2010/05/02/accessing-of-rows-in-silverlight-datagrid.aspx#221095<pubdate>Thu, 03 Feb 2011 11:05:33 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:221095</guid><dc:creator>DamirDobric</dc:creator><description>&lt;p&gt;Registering of Click event of a button contained in the datatemplate of datagrid which is contained in&lt;/p&gt;
&lt;img src="http://developers.de/aggbug.aspx?PostID=221095" width="1" height="1"&gt;</description></item><item><title>How to register Button ClickHandler of button in DataGrid in TemplateControl</title><link />http://developers.de/blogs/damir_dobric/archive/2010/05/02/accessing-of-rows-in-silverlight-datagrid.aspx#221097<pubdate>Thu, 03 Feb 2011 10:08:05 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:221097</guid><dc:creator>Damir Dobric Posts</dc:creator><description>&lt;p&gt;Registering of Click event of a button contained in the datatemplate of datagrid which is contained in&lt;/p&gt;
&lt;img src="http://developers.de/aggbug.aspx?PostID=221097" width="1" height="1"&gt;</description></item><item><title>re: Accessing of Rows in Silverlight DataGrid</title><link />http://developers.de/blogs/damir_dobric/archive/2010/05/02/accessing-of-rows-in-silverlight-datagrid.aspx#221929<pubdate>Fri, 21 Jan 2011 11:53:40 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:221929</guid><dc:creator>Sunil Gohel</dc:creator><description>&lt;p&gt;I think there is no any Last() method in IEnumerator interface..&lt;/p&gt;
&lt;p&gt;I have taken the code but it gives me an error that Last() could not found.&lt;/p&gt;
&lt;p&gt;Can u elobrate this.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=221929" width="1" height="1"&gt;</description></item><item><title>re: Accessing of Rows in Silverlight DataGrid</title><link />http://developers.de/blogs/damir_dobric/archive/2010/05/02/accessing-of-rows-in-silverlight-datagrid.aspx#28692<pubdate>Thu, 23 Dec 2010 19:53:16 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:28692</guid><dc:creator>beauXjames</dc:creator><description>&lt;p&gt;I do appreciate the post here...the use case was to cross apply a series of different SolidColorBrushes to various rows in a single grid based on a certain key value in one of the columns. The cool little extension I applied to extend this concept was assigning a type to the rowItem, which was then open all too easily to the code for running logic on a row-by-row basis...and, of course, when streamingly fast.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=28692" width="1" height="1"&gt;</description></item></channel></rss>