Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 7th, 2007, 04:29 PM
Registered User
 
Join Date: Feb 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Simple Databinding to Datarow, values not updating

Hi, I have a loop that is populating label controls from a Datatable. If I simple bind the datarow to the labels' Text property, when I update the Datatable I expected the changes to be reflected in the label. This is true if I bind the the table directly.

// this shows the correct values but they don't update when I update the data in the table
...
templabel.DataBindings.Add("Text", dt.Rows[i], "state");
...

// when I bind directly to the table, updating the table does reflect the changes. But this option is no good as all my label controls have the same values.
...
templabel.DataBindings.Add("Text", dt, "state");
...

Thanks!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating Bound Controls Values automatically Borhani Excel VBA 0 January 20th, 2008 12:48 PM
updating values DennyLoi Javascript How-To 1 November 26th, 2007 01:34 PM
Need help understanding DataRow asp_convert ADO.NET 3 March 13th, 2007 02:39 PM
databinding , simple question lwebzem ASP.NET 2.0 Basics 0 January 25th, 2007 03:06 PM
Updating boolean values using datalist Scripts82 ASP.NET 1.0 and 1.1 Basics 1 September 20th, 2006 04:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.