Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

DataGridView Data

Posted on 2006-07-03
4
Medium Priority
?
255 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

618 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