473,563 Members | 2,517 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Databinding to the rft property on a richtextbox

Hi all.

I cant databind rtf values to the rtf property of a winform
richtextbox control. Does something have a clue how this i done?

Ive tried this without luck:
this.richTextBo x1.DataBindings .Add(new
System.Windows. Forms.Binding(" Rtf", this.dataSet1, "rftdescription "));

Its no trouble doing it the the Text property with text values like
this.
this.richTextBo x1.DataBindings .Add(new
System.Windows. Forms.Binding(" Text", this.dataSet1, "description")) ;

Im using mssql server, and typed datasets.
Nov 16 '05 #1
2 7386
bu******@hotmai l.com (Thomas Solh?j) wrote in message news:<39******* *************** ***@posting.goo gle.com>...
Hi all.

I cant databind rtf values to the rtf property of a winform
richtextbox control. Does something have a clue how this i done?

Ive tried this without luck:
this.richTextBo x1.DataBindings .Add(new
System.Windows. Forms.Binding(" Rtf", this.dataSet1, "rftdescription "));

Its no trouble doing it the the Text property with text values like
this.
this.richTextBo x1.DataBindings .Add(new
System.Windows. Forms.Binding(" Text", this.dataSet1, "description")) ;

Im using mssql server, and typed datasets.


The solution:

Make a get-set property on the control you wish to databind to and
give it this attribute:

[EditorBrowsable (EditorBrowsabl eState.Advanced )]

Then you can set the databinding through the advanced box in the
designer.
Nov 16 '05 #2
Hmm... I'm going to have to this at run time. (I'm binding to a field in an
array that will be built sometime after the program starts).

I cant bind to RTF field in run time?

"Thomas Solh?j" wrote:
bu******@hotmai l.com (Thomas Solh?j) wrote in message news:<39******* *************** ***@posting.goo gle.com>...
Hi all.

I cant databind rtf values to the rtf property of a winform
richtextbox control. Does something have a clue how this i done?

Ive tried this without luck:
this.richTextBo x1.DataBindings .Add(new
System.Windows. Forms.Binding(" Rtf", this.dataSet1, "rftdescription "));

Its no trouble doing it the the Text property with text values like
this.
this.richTextBo x1.DataBindings .Add(new
System.Windows. Forms.Binding(" Text", this.dataSet1, "description")) ;

Im using mssql server, and typed datasets.


The solution:

Make a get-set property on the control you wish to databind to and
give it this attribute:

[EditorBrowsable (EditorBrowsabl eState.Advanced )]

Then you can set the databinding through the advanced box in the
designer.

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1497
by: DraguVaso | last post by:
Hi, I'm having the following situation: - A class clsFournisseur with public property's which raise a MyPropertyChanged-event in the Set-method for each Property. Public Event NomChanged As EventHandler Public Property Nom() As String Get Return m_strNom
2
1714
by: Colin Robinson | last post by:
Help please I have an example class called Person with 2 public properties Firstname and Lastname, I cant create a textbox on an asp.net form bound to the Person.Firstname property Can anyone help with the required syntax? if i do TExtbox1.text = x.firstname it works ok, but I want to edit the textbox setting the value of x.firstname.
0
2128
by: James Manila Dot Net | last post by:
I've been having a major problem using the Rtf property of the Richtextbox. I use the RTB to generate RTF code to save it in an access database. I'm successfully able to do this. However, the moment I retrieve the RTF code from the database back to the Rtf property, it ignores any tags that refer to bullet information. I don't understand...
11
11545
by: John J. Hughes II | last post by:
I have a DataGridView displaying data from a DataSet. To the right of that I have a custom user control which displays one of the data set fields. The custom user control is bound to the data set object and displays the data correctly when I move from row to row. The problem I am having is the data set always reads the data back and...
7
2007
by: Naveen | last post by:
I posted this message to another board and have hardly had any views on it, leave alone answers. So I am cross-posting here. This may be a very simple question but I can't get my head around it. I have a textbox's enabled property bound to the IsNew property of an object. this.txtPhone1.DataBindings.Add("Enabled", this.BindingSource,...
8
2078
by: Dirk | last post by:
Hello, I have a problem to use databinding with my business layer classes. My data class does not have simple properties (string, int or datetime), instead, all my properties are objects of the generic type Field<T> (see sample code). public class Employee { public Field<stringForename
1
1621
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hello to all, I want to know if DataBinding in asp.net 2,0 is better than to fill up the values of the controls of the following form: this.miControlTextBox.Text = valorParaControlTextbox; Performance with databinding is good in asp.net 2.0 ? Would you prefer: databinding or set value to Text property of control ?
3
1878
by: Peter | last post by:
Hi! I am having some very strange behavior with my databound controls. It's taken a long time to isolate exactly what is provoking the problem, but I'm still leagues away from solving it. I have a DataView which filters a DataSet. Bound to this dataview is a ListBox, via its DataSource property. The DisplayMember is the name property of...
4
3308
by: Jason Wolf | last post by:
I have an object which runs in a sperate thread, from the main thread, and while running it updates a public property. In my main form I defined databinding on the property and I would like to see this databinding update my form property to reflect the value of the other components property, but it does not happen. My binding is...
0
7579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7877
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7943
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5479
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3615
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2077
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
912
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.