|
-
Feb 19th, 2004, 02:29 PM
#1
Thread Starter
Hyperactive Member
Highlighting datagrid row
How can I highlight an entire datagrid row by clicking anywhere in a row?
I tried the following:
DataGrid1.Select(DataGrid1.CurrentCell.RowNumber)
In the CurrentCellChanged event but it changes the appearance of the selected cell. Any ideas?
A cynic knows the price of everything but the value of nothing.
-
Feb 19th, 2004, 02:57 PM
#2
New Member
Hi
Just study this with code example. can be in help
http://www.dotnetbips.com/displayarticle.aspx?id=205
brgds
Krasimir
-
Feb 23rd, 2004, 05:44 PM
#3
Thread Starter
Hyperactive Member
I put this in the MouseUp event:
Dim pt = New Point(e.X, e.Y)
Dim hti As DataGrid.HitTestInfo = DataGrid1.HitTest(pt)
If hti.Type = DataGrid.HitTestType.Cell Then
DataGrid1.CurrentCell = New DataGridCell(hti.Row, hti.Column)
DataGrid1.Select(hti.Row)
End If
A cynic knows the price of everything but the value of nothing.
-
Feb 23rd, 2004, 05:51 PM
#4
Lively Member
Can also try this row in CurrentCellChanged event:
DataGrid1.Select(DataGrid1.CurrentRowIndex)
-
Nov 27th, 2005, 01:56 PM
#5
New Member
Re: Highlighting datagrid row
http://www.freevbcode.com/ShowCode.asp?ID=5746
this is a great sample code example of how to do this plus a few other little things that may be useful. works great out of the box, and was easy to add to a project with very little modding to get it to work.
I found it and just thought it may help some others who need this too.
This example is for use with a winform.
Last edited by vbxPuppet; Nov 27th, 2005 at 02:20 PM.
-
Nov 27th, 2005, 06:09 PM
#6
Lively Member
Re: Highlighting datagrid row
Looks good, thanks vbxPuppet. I got this solved for long ago, but it's a good example to anybody who needs it...
As you are interested in Winforms Datagrids, maybe you know some handy way to apply "autocomplete" in Datagrid ComboBox - i.e. getting first matching result by typing the first letters...
I know how to do it in normal ComboBox, but not in Datagrid... Would you have any good code sample for such of Class or any tips..?
(Framework 1.1)
-
Dec 2nd, 2005, 07:08 PM
#7
New Member
Re: Highlighting datagrid row
sorry but no,
I also have now moved all my projects to 05, and framework 2.0
the datagridview is worth the upgrade alone, plus all the other really kewl stuff they shoved up vs's ars ;>
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
|