EDN Admin
Well-known member
i have a xml file containing list of elements
<pre class="prettyprint" style=" <listxml> <list>
<control>featured</control>
<title>All Boys must watch this(Article 15 of Indian Constitution)</title>
<video>/hot/109_All_Boys_must_watch_this(Article_15_of_Indian_Constitution).mp4</video>
<picture>http://img.youtube.com/vi/DOjZxM5FF14/1.jpg</picture>
<categories>general </categories>
</list> <list>
<control>featured</control>
<title>All Boys2</title>
<video>/hot/109_All_Boys_must_watch_this(Article_15_of_Indian_Constitution).mp4</video>
<picture>http://img.youtube.com/vi/DOjZxM5FF14/1.jpg</picture>
<categories>general </categories>
</list>
</listxml> [/code]
<br/>
now i use this statement to show the items.
employeesList.ItemsSource = listxml.Collection.Where(emp => emp.control.Contains("featured")).ToList();<br/>
but now i wanted to get only one item randomly in my employeesList.ItemsSource.
<
<br/>
<br/>
View the full article
<pre class="prettyprint" style=" <listxml> <list>
<control>featured</control>
<title>All Boys must watch this(Article 15 of Indian Constitution)</title>
<video>/hot/109_All_Boys_must_watch_this(Article_15_of_Indian_Constitution).mp4</video>
<picture>http://img.youtube.com/vi/DOjZxM5FF14/1.jpg</picture>
<categories>general </categories>
</list> <list>
<control>featured</control>
<title>All Boys2</title>
<video>/hot/109_All_Boys_must_watch_this(Article_15_of_Indian_Constitution).mp4</video>
<picture>http://img.youtube.com/vi/DOjZxM5FF14/1.jpg</picture>
<categories>general </categories>
</list>
</listxml> [/code]
<br/>
now i use this statement to show the items.
employeesList.ItemsSource = listxml.Collection.Where(emp => emp.control.Contains("featured")).ToList();<br/>
but now i wanted to get only one item randomly in my employeesList.ItemsSource.
<
<br/>
<br/>
View the full article