I wanted to see if there was some way to simplify finding the current, selected row when filtered. In short, I want to get the value of a cell from a contextmenuopening event
I have many grids that will call the same context menu, customized by the calling control, and simply want to get a cell value based on the current row, filtered or unfiltered. Here is some code and an illustration.
The attached image shows a context menu where I need to get the value of a column for the selected row. Can this be simplified or determined by using the child row?
'this creates the context menu custom for the form/grid
e.ContextMenu = frm_CvBase.mnuCVMainGrid.DropDown
'handles all context menu clicks
'get the value of the current row based on a given column (data driven)
sCellValue = grdMain.Rows(grdMain.CurrentRow.Index).Cells(col.Index).Value.ToString.Trim
'this works unfiltered, not filtered - as I know.
'Is there a simple way to get the 'current' row WITHOUT adding code to a CurrentRowChanged event for every grid?