![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | selected row visible Hi The following code is in the load event of a form. When the user rightclicks on a row in a datagridview, the selected information is passed on to this form. Dim tbl As New Data.DataTable tbl = Me.grd.DataSource Dim strSelect As String Dim ab As Integer strSelect = "" For ab = 0 To tbl.Columns.Count - 1 strSelect += tbl.Columns(ab).ColumnName + " LIKE '" + myRowData(ab) + "'" If ab < tbl.Columns.Count - 1 Then strSelect += " AND " Next Dim foundRows() As Data.DataRow foundRows = tbl.Select(strSelect) SelRow = foundRows(0).Table.Rows.IndexOf(foundRows(0)) Me.grd.Rows(SelRow).Selected = True ' now move the current cell to the top Me.grd.CurrentCell = Me.grd.Rows(SelRow).Cells(0) Me.grd.FirstDisplayedScrollingRowIndex = SelRow In the datagridview of the second form, I want the selected row to show up at the top of the datagridview. But it is not happening. Nothing seems to happen with the last line, which should do the job. Who can help me with this? rg, Eric |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Get value of first cell in selected row in DataGridView? | .NET General | |||
| scanner selected cannot be found | Vista print fax & scan | |||
| Selected message in newsgroup | Vista mail | |||
| How to backup only selected files? | Vista file management | |||
| Backup Selected Files Only? | Vista performance & maintenance | |||