|
-
Feb 6th, 2011, 11:40 PM
#1
Thread Starter
Member
Get DataGridView Row
Hi All,
I have a datagridview. FullRowSelect property of datagridview has been set to False. So user only play with cell values.
I need DataGridView Row using selected cell value.
Can any one please help me how can it possible.
Thankx
Vijay
-
Feb 7th, 2011, 01:12 AM
#2
Re: Get DataGridView Row
Firstly, not that "current" and "selected" mean different things in this context. "Current" means where the caret is currently located while "selected" means highlighted. There can only ever be one current row and one current cell at a time, while you can have multiple selected rows and cells, depending on the configuration.
If you want the row containing the current cell then just use the CurrentRow property. If you want the rows containing the selected cells then loop through the SelectedCells collection and get the OwningRow of each one. Just note that that may contain duplicates if multiple cells in the same row are selected.
-
Feb 7th, 2011, 03:42 AM
#3
Thread Starter
Member
Re: Get DataGridView Row
So, can u tell me how can i get the first row's cell value depending upon current cell index.
-
Feb 7th, 2011, 03:59 AM
#4
Re: Get DataGridView Row
You know about the CurrentRow. Like all rows, it has a Cells property that is a collection of cells. Each of those has a Value property.
-
Feb 7th, 2011, 04:13 AM
#5
Thread Starter
Member
Re: Get DataGridView Row
Thankx, Yes I know the Current Row property. Thankx for pointing me on right track
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
|