2 Replies - 1495 Views - Last Post: 14 January 2013 - 01:23 PM Rate Topic: -----

#1 kristina1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 41
  • Joined: 30-July 12

how to check the checkbox in datagridview cell vb.net

Posted 14 January 2013 - 01:00 PM

hi,
i have a datagridview in my application in vb.net and the second visible column is a checkbox.

i want in the form load the checkbox in the fist row to be checked programatically but i am not finding the proper code to achieve this, something like ....gridview_name.rows[0].columns[1].checked = true...
the indexes of the rows and columns start from 0 or from 1? are the invisible columns count?

thank a lot for your time and help

Is This A Good Question/Topic? 0
  • +

Replies To: how to check the checkbox in datagridview cell vb.net

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8937
  • View blog
  • Posts: 33,485
  • Joined: 12-June 08

Re: how to check the checkbox in datagridview cell vb.net

Posted 14 January 2013 - 01:05 PM

Moving to VB.NET...

Please be aware of what you are posting in which forum.

Quote

....gridview_name.rows[0].columns[1].checked = true...

You know VB.NET doesn't use brackets for arrays, right? It's all parenthesis.

Quote

the indexes of the rows and columns start from 0 or from 1?

As with almost all the datastructures the first element is 0... why is that? That happens because it is a collection (of rows).. and collections start at 0.
Was This Post Helpful? 0
  • +
  • -

#3 kristina1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 41
  • Joined: 30-July 12

Re: how to check the checkbox in datagridview cell vb.net

Posted 14 January 2013 - 01:23 PM

thanks, i already solved the problem
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1