473,503 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Programmatically inserting newlines into a dataGridViewTextBoxCell.

HaLo2FrEeEk
404 Contributor
I have some information I want to put into a dataGridViewTextBoxCell, but I don't want it all on one line. The information is being put in programmatically, so no use input for it. I've tried the simple:

dataGridViewTextBoxCell infoCell = new dataGridViewTextBoxCell();
infoCell.Value = "testline1" + Environment.NewLine + "testline2";

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

testline1testline2

Is there any way to achieve multiline text in a datagridviewtextboxcell?

Thank you in advance.
Nov 25 '09 #1
2 2896
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
4539
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...
4
2475
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). ...
6
2604
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...
1
1784
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...
14
28077
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)...
0
1361
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
1975
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...
2
3916
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...
4
22302
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...
0
7205
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,...
0
7093
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...
0
7348
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...
1
7006
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3175
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...
0
1519
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
397
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.