Solved

What is the highlight Column event for VB6 DataGrid?

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

760 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

19 Experts available now in Live!

Get 1:1 Help Now