Here is a Silverlight demo for getting stock quotes using data grid. It also demos how to use stored cache to save all the queried symbol before.
The design would like:
I used Visual Studio 2008 SP1 with Silverlight 2.0 RC. For stock quotation service, I chose http://www.webservicex.net/stockquote.asmx/GetQuote?symbol=SYMBOLNAME for the demo.
The service returned the following which contains interesting double layered XML string.
<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://www.webserviceX.NET/"><StockQuotes><Stock><Symbol>MSFT</Symbol><Last>25.50</Last><Date>10/13/2008</Date><Time>4:00pm</Time><Change>+4.00</Change><Open>N/A</Open><High>25.50</High><Low>22.63</Low><Volume>143039616</Volume><MktCap>232.8B</MktCap><PreviousClose>21.50</PreviousClose><PercentageChange>+18.60%</PercentageChange><AnnRange>20.65 - 37.50</AnnRange><Earns>1.867</Earns><P-E>11.52</P-E><Name>MICROSOFT CP</Name></Stock></StockQuotes></string>
The complete project can be downloaded from the attached file to this blog. The current update added IsReadOnly="True" to data:DataGrid in page.xaml, by Ken's suggestion.