|
-
Apr 5th, 2010, 10:29 PM
#1
Re: how to get the row index value in datagridview
When you're working with bound data you should almost exclusively work with the BindingSource. That's what it's for. In this case the DataGridView is irrelevant.
Call the Find method of the BindingSource and it will return the index of the matching row if there is one. If there is, you index the BindingSource to get that row and update the appropriate fields. If there isn't, you call the AddNew method of the BindingSource to create a new row and set the appropriate fields.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|