Note that there are some explanatory texts on larger screens.

plurals
  1. POgrid view Test box new line display
    text
    copied!<p>I am using grid view and item template text box in ASP.NET USING C#. I am entering text in one line and using entered key again entered text in second line.</p> <p>BUt after updating i am getting out put data in one line(I used 50 char length in one line.).</p> <p>Ex.</p> <p>My first line text. THIS IS TEST JAN 13TH.</p> <p>second line code</p> <p>Hello ravi</p> <p>After updating i am getting like</p> <p>THIS IS TEST JAN 13TH. Hello ravi</p> <p>This is my current code i am using.</p> <p>private CommandArg GetUpdateCommentArgs(int rowIndex) { var retVal = new CommandArg { ObjectParamCollection = new Dictionary() };</p> <pre><code> var commentTxt = new string[] { }; object val = null; var cmtTb = GridView1.Rows[rowIndex].FindControl("txtComments") as TextBox; if (cmtTb != null) { cmtTb.Text = cmtTb.Text.Replace("\r\n", " "); var los = cmtTb.Text.Length; if (los &gt; 100) cmtTb.Text = cmtTb.Text.Substring(0, 100); commentTxt = los &gt; 50 ? new[] {cmtTb.Text.Substring(0, 50), cmtTb.Text.Substring(50)} : new[] {cmtTb.Text}; } var key = GridView1.DataKeys[rowIndex]; if (key != null) val = key.Value; if (Page is ClaimBase) { var p = Page as ClaimBase; var ci = p.ClaimantInfoHelper; if (ci != null) { if (val != null) { var seq = 0; if (Int32.TryParse(val.ToString(), out seq)) { var cmtInput = new CommentUpdateInputEntity { ClaimNumber = ci.ClaimNum , CertificateSequence = ci.ClaimCertSeqNo , Sequence = seq , CommentText1 = commentTxt[0] }; if (commentTxt.Length &gt; 1) cmtInput.CommentText2 = commentTxt[1]; retVal.ObjectParamCollection.Add("entity", cmtInput); } } } } return retVal; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload