1 Replies - 85 Views - Last Post: 08 February 2012 - 08:58 AM Rate Topic: -----

Topic Sponsor:

#1 GTTravis  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 18-November 11

Datagridview help

Posted 08 February 2012 - 08:29 AM

Hi Guys,

I am having a little programming jam at the moment. i have a datagridview set up whenever the user selects a row i am able to capture the necessary details but what i really want is the next row providing that the user selects the previous row.

example

users selects row 5

i want to capture row six details providing that there is a row six.


enclosed is the code snippet used to capture the selected row.

For Each rowd As DataGridViewRow In DataGridViewTransactions.SelectedRows
            Call GlobalFunctions.DeleteTransactionControl(rowd.Cells(0).Value, rowd.Cells(1).Value, rowd.Cells(4).Value, rowd.Cells(7).Value, "Delete")
        Next rowd


Is This A Good Question/Topic? 0
  • +

Replies To: Datagridview help

#2 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 960
  • View blog
  • Posts: 3,354
  • Joined: 25-September 09

Re: Datagridview help

Posted 08 February 2012 - 08:58 AM

Get the currentrow index, if the delete button is pressed and there is a valid index+1 then you would use
rows(index+1).cells(1).Value...

This post has been edited by CharlieMay: 08 February 2012 - 09:02 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1