Solved

What is the highlight Column event for VB6 DataGrid?

Posted on 2010-08-18
2
729 Views
Last Modified: 2013-12-26
Hi All

I have built a Function that sorts columns on DataGrid1_HeadClick() event. Basically it sorts Asc if previous was Desc and Vice Versa. Problem is the data is sorted and the .Bookmark moves to the First row position, which is fine, but the Column highlight remains.

DataGrid control has always behaved this way i.e. if you click a header, whether sorting or not it highlight's entire column.

So problem is that I have built a Search function that moves the .Bookmark to appropriate row and even though I highlight the Row found, Using "DataGrid1.SelBookmarks.add FindData.Recordset.Bookmark" the Column highlight remains unless you physically fire the Row Click event.

So I end up with a Highlighted Black Cross effect ie. both Column and Row are highlighted.

So does anyone Know what Event Controls the Column highlight, and if so how to turn the blasted thing off??

I have looked everwhere on Google for this and can't find an answer.

Thanks
FLOG51
0
Comment
Question by:FLOG51
2 Comments
 
LVL 17

Accepted Solution

by:
Zhaolai earned 500 total points
ID: 33471703
Try this:

In the DataGrid1_HeadClick event, add this line,

    DBGrid1.SelStartCol = -1

0
 

Author Closing Comment

by:FLOG51
ID: 33471788
Hi Zhaolai

Thank You, Exactly what I was after.

Isn't it amazing how 4 hours of investigation and frustration can be solved with one very short line of Code. Gotta love programming!!!.

Thanks Again
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question