Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting a full row in a datagrid

Status
Not open for further replies.

afryer

Programmer
Mar 9, 2004
207
GB
Hi All,

I have in my application a datagrid, which is linked to a data environment. What I need to be able to do is when the OnClick () event is called on the data grid I need to select the entire row. Is there anyway I can do this?

Thanks in advance


Andrew
 
There is no OnClick event with the MS DataGrid.
Maybe you mean MS Access?
If you mean the MSDataGrid in VB6, then you have two options:

1. When the user clicks on a row: Set the DataGrid's MarqueeStyle to 3 (MSDataGridLib.dbgHighlightRow)

2. When the user clicks on the far left side of a row in the grey area (can also hold down the Shift to select several rows).
This will add the selection to the Bookmarks collection. This can also be done in code. See the DataGrid1.SelBookmarks methods to select and add a row to the bookmark collection, and to read which rows are selected use the DataGrid1.Bookmark collection
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top