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
Printable View
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
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.
So, can u tell me how can i get the first row's cell value depending upon current cell index.
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.
Thankx, Yes I know the Current Row property. Thankx for pointing me on right track