Datarepeater: datasource as richtextbox.text

Xancholy

Well-known member
Joined
Aug 29, 2006
Messages
143
Programming Experience
Beginner
I am using the MS VB powerpack 3 datarepeater control.

I have a richtextboxSource, datarepeater1 on my form

I would like to add a docked richtextboxTarget to my datarepeater1

The datasource for each row(richtextboxTarget) in the datarepeater1 will be the output of richtextboxSource's paragraphs, something like:

VB.NET:
For Each para As String In System.Text.RegularExpressions.Regex.Split(RichTextBoxSource.Text, ControlChars.Lf & ControlChars.Lf)

             datarepeater1.richtextboxTarget.text= para
Next
Can someone please show me how to code this properly. My code does not work.
 
Add the strings to a Datatable, create a DataBinding for the item template control, then set DataSource of repeater:
VB.NET:
Dim dt As New DataTable
dt.Columns.Add("para")
dt.Rows.Add("string 1")
dt.Rows.Add("string 2")
Me.RichTextBox1.DataBindings.Add("Text", dt, "para")        
Me.DataRepeater1.DataSource = dt
 
Thanks.
Is it possible for Datarepeater to simulate rowheaders for every para (row) ?
"Paras" will the columnheader

Para1 will have a rowheader called "Para1", followed by para1.text in the row
same with Para2, etc

Hope I'm being clear enough. pdf attached if unclear.
 

Attachments

  • Rowheaders.pdf
    1.9 KB · Views: 12
Last edited:
Add a Label to the ItemTemplate, bind Text property to the rowheader column.
 
Back
Top