• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 780
  • Last Modified:

What is the highlight Column event for VB6 DataGrid?

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
FLOG51
Asked:
FLOG51
1 Solution
 
ZhaolaiCommented:
Try this:

In the DataGrid1_HeadClick event, add this line,

    DBGrid1.SelStartCol = -1

0
 
FLOG51Author Commented:
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

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now