Programmatically inserting newlines into a dataGridViewTextBoxCell.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HaLo2FrEeEk
    Contributor
    • Feb 2007
    • 404

    Programmatically inserting newlines into a dataGridViewTextBoxCell.

    I have some information I want to put into a dataGridViewTex tBoxCell, but I don't want it all on one line. The information is being put in programmaticall y, so no use input for it. I've tried the simple:

    dataGridViewTex tBoxCell infoCell = new dataGridViewTex tBoxCell();
    infoCell.Value = "testline1" + Environment.New Line + "testline2" ;

    with no effect, the text in the cell looks like this:

    testline1testli ne2

    Is there any way to achieve multiline text in a datagridviewtex tboxcell?

    Thank you in advance.
  • Minion
    Recognized Expert New Member
    • Dec 2007
    • 108

    #2
    From my experience the datagrid does not except multi-line entry. Not sure what you're trying to accomplish in the end, but you could use a pipe "|" as a delimeter and parse this for output later.

    Hope this helps.

    Comment

    • HaLo2FrEeEk
      Contributor
      • Feb 2007
      • 404

      #3
      I want to actually display multiline cells. It's going to be the description for a thumbnail image being displayed in an imagecell. It's not a big deal now though, I figured out a better way to do it.

      Comment

      Working...