Databinding to the rft property on a richtextbox

  • Thread starter Thread starter Thomas Solh?j
  • Start date Start date
T

Thomas Solh?j

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.
 
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.
 
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 said:
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.
 
Back
Top