[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 256
  • Last Modified:

DataGridView Data

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
Rowdyone52
Asked:
Rowdyone52
  • 2
  • 2
1 Solution
 
JigitCommented:
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
 
Rowdyone52Author Commented:
How do I shift enter when I do it by coding, rather than manually entering it?

Datagrid1.rows[0].cells[0].value = ?
0
 
Rowdyone52Author Commented:
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
 
JigitCommented:
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now