Only first line is displayed in a multiline textbox

2 posts, 1 answers
  1. Cheryl
    Cheryl avatar
    7 posts
    Member since:
    Aug 2012

    Posted 26 Mar 2009 Link to this post

    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!

  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Mar 2009 Link to this post

    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
Back to Top