getting the values of hiding columns on datagridview

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

can anybody help about this subject??? I have to hide some columns with
visible=false but I need their value. With a gridview in a website I used
datakeys, but with a datagridview there are no such thing.
 
You can still access the columns and manipulate their cell values even
when they're hidden. Just use the regular row and column syntax like
this:
// the second 0 is column index
dataGridView1.Rows[0].Cells[0].Value = "Hello";
or
// can also use column name
dataGridView1.Rows[0].Cells["Column2"].Value = "World";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top