Finding a row in a DataGridView object

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • isaacsfa
    New Member
    • Jul 2007
    • 1

    Finding a row in a DataGridView object

    Hello,
    I'm trying to remove a row that exists in a DataGridView object based on the content in the cell in its first column. I can't seem to figure out a way to do this! I know I can remove a row based on its index, but I can't figure out how to get the index of a row based on the contents of a cell in that row.

    Thanks for the help

    Isaac
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by isaacsfa
    I'm trying to remove a row that exists in a DataGridView object based on the content in the cell in its first column. I can't seem to figure out a way to do this! I know I can remove a row based on its index, but I can't figure out how to get the index of a row based on the contents of a cell in that row.
    It's probably not the best method, but perhaps the simplest would be to scan through the entire view, one row at a time, until you find the one you're interested in. Then you should have have the index so you can zap it.

    Comment

    Working...