StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



changing Datasource for Grid ControlExpand / Collapse
Author
Message
Posted 11/27/2006 11:50:36 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 12/21/2006 6:55:27 AM
Posts: 1, Visits: 9
Hi..

i am using a Datagrid control in my application.
i am binging a datatable to grid on page load.
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.
i tried grid.refresh(), grid.refreshdatasource() but problem still exists.

when i bound the same datatable i deserialized from stream with no datasource bound to grid then am values are displayed on grid.

please help.

The code is as follows.

dtOffers = b.Deserialize(fileStream) as DataTable;
dtOffers.RemotingFormat = SerializationFormat.Binary;
if (dtOffers != null)
{
gridOffer.BeginUpdate();
gridOffer.DataSource = null;
gridOffer.DataSource = dtOffers;
gridOffer.RefreshDataSource();
gridOffer.EndUpdate();
}
Post #4787
Posted 11/28/2006 9:02:11 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 11:24:42 AM
Posts: 2,686, Visits: 1,889
Are you binding to a business object or directly to a DataTable?

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.


www.bungie.net
Post #4789
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 1:29pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.125. 11 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.