DataGrid in .Net
-
I was able to load the datagrid correctly and fill it. What I am trying now to accomplish is how to highlight a whole row when I user either tabs down or clicks the row. As of now it highlights just one column of the row. I want to be able to highlight the whole row and have a user click the row to get the info the user is requesting. Thanks:) Beginner in ASP.Net and VB.Net
-
I was able to load the datagrid correctly and fill it. What I am trying now to accomplish is how to highlight a whole row when I user either tabs down or clicks the row. As of now it highlights just one column of the row. I want to be able to highlight the whole row and have a user click the row to get the info the user is requesting. Thanks:) Beginner in ASP.Net and VB.Net
.NET Framework Class Library DataGrid.Select Method (Int32) http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWindowsFormsDataGridClassSelectTopic1.asp
-
.NET Framework Class Library DataGrid.Select Method (Int32) http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWindowsFormsDataGridClassSelectTopic1.asp
That is the right track but if a user clicks on (row 1 column 3) then all the data for (row 1 column 1) and (row 1 column 2) disappears and the whole row is highlighted. I have seen this done in programs so I know its possible. Right now my rows alternate colors with light blue and baby blue. When a user selects a row they want to view, then I want to highlight that row to stand out like with a yellow or even a darker blue to make it look different from the rest. Thanks Beginner in ASP.Net and VB.Net
-
That is the right track but if a user clicks on (row 1 column 3) then all the data for (row 1 column 1) and (row 1 column 2) disappears and the whole row is highlighted. I have seen this done in programs so I know its possible. Right now my rows alternate colors with light blue and baby blue. When a user selects a row they want to view, then I want to highlight that row to stand out like with a yellow or even a darker blue to make it look different from the rest. Thanks Beginner in ASP.Net and VB.Net
Highlight an Entire Row in VB.NET WinForms DataGrid description: http://www.freevbcode.com/ShowCode.asp?ID=5746 source: http://www.freevbcode.com/source/HighlightingRowInDataGrid.zip
-
I was able to load the datagrid correctly and fill it. What I am trying now to accomplish is how to highlight a whole row when I user either tabs down or clicks the row. As of now it highlights just one column of the row. I want to be able to highlight the whole row and have a user click the row to get the info the user is requesting. Thanks:) Beginner in ASP.Net and VB.Net
you've probably sorted it now but a really simple way would be Private Sub DataGrid1_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.CurrentCellChanged Dim oCell As DataGridCell oCell = DataGrid1.CurrentCell Dim lRowNum As Long lRowNum = oCell.RowNumber With DataGrid1 .Select(lRowNum) End With End Sub "If i was king cigarettes would be free."