﻿<?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 - V1 » WinForms (How do I?)  » changing Datasource for Grid Control</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 00:35:03 GMT</lastBuildDate><ttl>20</ttl><item><title>changing Datasource for Grid Control</title><link>http://forum.strataframe.net/FindPost4787.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>Tue, 28 Nov 2006 09:02:11 GMT</pubDate><dc:creator>Amadneep Kirar</dc:creator></item><item><title>RE: changing Datasource for Grid Control</title><link>http://forum.strataframe.net/FindPost4789.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.&amp;nbsp; 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>StrataFrame Team</dc:creator></item></channel></rss>