473,473 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Create 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.richTextBox1.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.richTextBox1.DataBindings.Add(new
System.Windows.Forms.Binding("Text", this.dataSet1, "description"));

Im using mssql server, and typed datasets.
Nov 16 '05 #1
2 7378
bu******@hotmail.com (Thomas Solh?j) wrote in message news:<39*************************@posting.google.c om>...
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.richTextBox1.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.richTextBox1.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(EditorBrowsableState.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******@hotmail.com (Thomas Solh?j) wrote in message news:<39*************************@posting.google.c om>...
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.richTextBox1.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.richTextBox1.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(EditorBrowsableState.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
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...
2
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...
0
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...
11
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...
7
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....
8
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...
1
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; ...
3
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...
4
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.