Solved

What is the highlight Column event for VB6 DataGrid?

Posted on 2010-08-18
2
724 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA : retain and exclude values based on a config sheet and multiple parameters 5 52
Adding to a VBA? 6 63
vbModal 12 38
Advice in Xamarin 21 57
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now