473,651 Members | 2,658 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Programmaticall y inserting newlines into a dataGridViewTex tBoxCell.

HaLo2FrEeEk
404 Contributor
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.
Nov 25 '09 #1
2 2905
Minion
108 Recognized Expert New Member
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.
Dec 2 '09 #2
HaLo2FrEeEk
404 Contributor
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.
Dec 3 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
4551
by: Christopher Finke | last post by:
I have a site wherein the clients can update the individual pages by editing the text of that page in a <textarea>. Then, when the page is displayed, all of the newlines (\n) are converted to HTML line breaks (<br />). However, I have come across some instances where I do not want to convert the newlines, such as the following: <table> <tr> .... </tr>
4
2480
by: Grant Edwards | last post by:
I'm using xml.sax to parse the "datebook" xml file generated by QTopiaDesktop. When I look at the xml file, some of the attribute strings have newlines in them (as they are supposed to). However, when xml.sax passes the attributes to my startElement() method the newlines seem to have been deleted. How do I get the un-munged element attribute values?
6
2619
by: dbee | last post by:
So I can't seem to urlencode a file with newlines ... it just gives me a series of T_STRING unexpected parse errors... cat job_description | while read file ; do php -r "echo urlencode('$file');" ; done > job_description_encoded && URL_ENCODED_DESCRIPTION=`cat job_description_encoded` .... this takes in a job_description file and outputs a file with alot of errors in the text ... ?
1
1800
by: dbee | last post by:
Hi, So I'm having a problem with disappearing newlines. I import the newlines from a file into my shell script fine. But then I process the text and the url_encode comes out the other end with linefeeds intact but no newlines. Also any single quotes in my file give me a T_STRING unexpected error in my output ... even though I'm using rawurlencode(). I've tried escaping them in my text but no luck there.
14
28125
by: Lauren Wilson | last post by:
Discovered this interesting comment on MSDN: "To programmatically obtain the hard disk's serial number that the manufacturer assigns, use the Windows Management Instrumentation (WMI) Win32_PhysicalMedia (a class) property SerialNumber." I'm sorry to admit it bit I am really undereducated on how to incorporate some of the Windows SDK stuff into VBA apps. Anyone know of some sample code that will allow us to read the C drive hardware...
0
1371
by: Nathan | last post by:
The textbox has Cut(), Copy(), and Paste() methods that can be called from, say, a menuitem click event. Is there a way to get a DataGridViewTextBoxCell to do the same thing?
2
1985
by: Edward K. Ream | last post by:
Hello all, I recently ran across a situation in which sax.saxutils.quoteattr did not work as I expected. I am writing Leo outlines as opml files http://en.wikipedia.org/wiki/OPML which forces me to write python code in xml attributes rather than xml elements (as is done in .leo files). The problem is that the sax parser I am using ignores newlines in attributes. After reading the thread at:
2
3943
by: Kevin | last post by:
I've created a custom class that inherits from the DataGridViewTextBoxColumn and DataGridViewTextBoxCell. The cell is databound to a text field that contains the path to a JPG image. The JPG image is displayed in the cell if the picture is present on the harddrive using Protected Overloads Overrides Sub Paint. The problem is that the image is only displayed in the cell when the cell receives the focus. How can I get it to paint the...
4
22319
by: lihao0129 | last post by:
Hi, folks: I recently went through a strange problem with my Javascript code, say: I have a string variable which are from a 'textarea' element and I want to remove the trailing newlines inside the string. I am using something like the following: var txt = textarea_element.value.replace(/\n*$/, ''); But this replaced only the last newline(by changing '' to 'K', and
0
8352
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8802
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8697
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7297
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5612
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4283
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1909
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.