Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
10
Answers
How to get complete column values from datagridview?
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
RD Design
9y
803
1
Reply
Hi,
I have a datagridview with 2 columns. Like below one
Heading1
Heading 2
BMW
2014
Jaguar
2005
Honda
2012
I need to get cell values (2014,2005,2012) of "Heading 2" column in to array.Have tried this way but not really success
foreach (DataGridViewRow row in dataGridView1.Rows)
{
foreach (DataGridViewCell cell in row.Cells)
{
if (cell.ColumnIndex == 1)
{
MessageBox.Show(cell.Value.ToString());
Application.Exit();
}
}
}
How can I achieve this?
Thanks
Post
Reset
Cancel
Answers (
10
)
Next Recommended Forum
How do i trigger tab key on press enter key?
query