Solved

DataGridView Data

Posted on 2006-07-03
4
247 Views
Last Modified: 2008-02-01
I would like to have a datagrid in which I can enter

this is text (newline)
this is more text

How do I enter a newline in a DataGridView Cell??

Also I would like to add label controls to a cell how can I do that?
0
Comment
Question by:Rowdyone52
  • 2
  • 2
4 Comments
 
LVL 4

Expert Comment

by:Jigit
ID: 17034049
Adding new line can be done by Ctrl-Enter or Shift-Enter.
Adding static label controls can be easily done by just putting <TD> in the datagrid; adding dynaminc (bound) label controls can be also easily done by binding the desired field to the DataGrid.
0
 

Author Comment

by:Rowdyone52
ID: 17034066
How do I shift enter when I do it by coding, rather than manually entering it?

Datagrid1.rows[0].cells[0].value = ?
0
 

Author Comment

by:Rowdyone52
ID: 17034087
Can you give me an example to binding the control?

I only see how to bind it to datagridview1.control.add(), but I need to do it on the cell level.
0
 
LVL 4

Accepted Solution

by:
Jigit earned 500 total points
ID: 17041478
How do I shift enter when I do it by coding, rather than manually entering it?
Datagrid1.rows[0].cells[0].value = "First line\r\nSecond line";
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Article by: Ivo
Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now