PC Review


Reply
Thread Tools Rate Thread

How to cause a repainting of a controls contents

 
 
Jerry
Guest
Posts: n/a
 
      5th Aug 2003
I'm using the format and parse events to present and interpret values in my
DataSet that I've binded to. The values are presented in units that can be
changed by the user, e.g. lb or kg. Normally the format event is fired when
the data changes. In this case the data doesn't change, just the constant
used in the format and parse methods. How do I get the controls to redisplay
the new conversion without changing the underlying DataSet? I've tried what
I thought should do it: Control.Invalidate and then Control.Update to no
avail.

Thanks,
Jerry


 
Reply With Quote
 
 
 
 
Jerry
Guest
Posts: n/a
 
      6th Aug 2003
Here is a solution that seems to work. In the method created to handle unit
changes I added the following code.

//Suspend and then Resume Binding to get data to be redisplayed

BindingManagerBase myBindingMngr = this.BindingContext[EntryDataSet,
"entries"];

myBindingMngr.SuspendBinding();

myBindingMngr.ResumeBinding();

This caused all controls bound to this BindingContext to be redisplayed.


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicating Contents of Content Controls =?Utf-8?B?TWF0dA==?= Microsoft Word Document Management 3 6th Jan 2007 06:13 PM
Reading Contents of Server Controls In ASP.net Rush Microsoft ASP .NET 0 30th Aug 2006 08:31 AM
Re: repainting controls Angel J. Hernández M. Microsoft C# .NET 0 28th May 2005 05:08 PM
Repainting the Arabic Contents =?Utf-8?B?U2FudGE=?= Windows XP Internet Explorer 0 17th Mar 2004 11:21 AM
Can you get the window handles/contents of controls with VB.net? rob Microsoft Dot NET 1 20th Oct 2003 08:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:18 PM.