This is a migrated thread and some comments may be shown as answers.

Only first line is displayed in a multiline textbox

1 Answer 88 Views
Input
This is a migrated thread and some comments may be shown as answers.
Cheryl
Top achievements
Rank 1
Cheryl asked on 27 Mar 2009, 12:18 AM

Hello,

 

I am trying to load data into a multiline textbox from a dataset.  The RadTextBox shows only the first line of text.  The same code using an ASP TextBos works fine.  Any tips?

ASPX:
 <telerik:RadTextBox ID="tb1" runat="server" Enabled="true" TextMode="MultiLine" Rows="4" Wrap="true" Width="100%" Columns="100"></telerik:RadTextBox>

 

 

 


<
asp:TextBox ID="tb2" runat="server" Enabled="true" TextMode="MultiLine" Rows="4" Wrap="true" Width="100%" Columns="100"></asp:TextBox>

 

 

 

 

 

 

 


Code Behind:

 

tb1.Text =

"";

 

  

 

 

foreach (DataRow dr in ds.Tables[0].Rows)

 {

 

    if (tb1.Text == "")

 

 

         tb1.Text = dr[

"Title"].ToString();

 

 

 

    else

 

 

 

 

        tb1.Text += Environment.NewLine + dr["Title"].ToString();

 

 

}

tb2.Text =

"";

 

 

 

 

 

foreach (DataRow dr in ds.Tables[0].Rows)

 {

 

    if (tb2.Text == "")

 

 

         tb2.Text = dr[

"Title"].ToString();

 

 

 

    else

 

        tb2.Text +=

Environment.NewLine + dr["Title"].ToString();

 

 

 }

 

 


Thanks!

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 27 Mar 2009, 08:31 AM
Hi Cheryl,

I have found the following forum link which discusses a similar scenario. Go through it and see if it helps to some extent.
RadTextBox multiline problem, only first line appearing.

Shinu
Tags
Input
Asked by
Cheryl
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or