﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum / StrataFrame Application Framework / WinForms (How do I?)  / changing Datasource for Grid Control / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>forum@strataframe.net</webMaster><lastBuildDate>Wed, 07 Jan 2009 17:38:00 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: changing Datasource for Grid Control</title><link>http://forum.strataframe.net/Topic4787-7-1.aspx</link><description>Are you binding to a business object or directly to a DataTable?&lt;/P&gt;&lt;P&gt;It could be that the new data table does not have the same columns as the first DataTable and therefore, none of the data is showing up.  You might try setting the AutoGenerateColumns property to True before you set the data source.</description><pubDate>Tue, 28 Nov 2006 09:02:11 GMT</pubDate><dc:creator>Ben Chase</dc:creator></item><item><title>changing Datasource for Grid Control</title><link>http://forum.strataframe.net/Topic4787-7-1.aspx</link><description>Hi..&lt;br&gt;&lt;br&gt;i am using a Datagrid control in my application.&lt;br&gt;i am binging a datatable to grid on page load.&lt;br&gt;and on a click event of a button i am binding another datatable to grid.which i deserialize from stream.but datagird shows me the DataCoulumns and Datarows only but not the values.&lt;br&gt;i tried grid.refresh(), grid.refreshdatasource() but problem still exists.&lt;br&gt;&lt;br&gt;when i bound the same datatable i deserialized from stream with no datasource bound to grid then am values are displayed on grid.&lt;br&gt;&lt;br&gt;please help.&lt;br&gt;&lt;br&gt;The code is as follows.&lt;br&gt;&lt;br&gt;dtOffers = b.Deserialize(fileStream) as DataTable;&lt;br&gt;dtOffers.RemotingFormat = SerializationFormat.Binary;&lt;br&gt;if (dtOffers != null)&lt;br&gt;{&lt;br&gt;        gridOffer.BeginUpdate();&lt;br&gt;        gridOffer.DataSource = null;&lt;br&gt;        gridOffer.DataSource = dtOffers;&lt;br&gt;        gridOffer.RefreshDataSource();&lt;br&gt;        gridOffer.EndUpdate();&lt;br&gt;}&lt;br&gt;</description><pubDate>Mon, 27 Nov 2006 23:50:36 GMT</pubDate><dc:creator>Amadneep Kirar</dc:creator></item></channel></rss>