Data Grid hit test

Phylum123

Newcomer
Joined
Feb 26, 2002
Messages
9
I know how to detect if a user has clicked on a column header, using a hittest. What I want to know is how to SIMULATE programically as if a user has clicked on a column header. Is this possible?

Phylum
 
Let me clarify why I want to be able to do this. I am making my own variation of the datagrid. I am trying to make a property for MY datagrid that allows you to know which column the datagrid is currently sorted by and which way (Asc or Dsc). Remember the user can hit a column header to resort the grid. Are there any properties that allow you to figure this out with the default datagrid?
 
Last edited:
You don't simulate the clicking of the header. Instead you create a property that remembers for you. This property is then updated when the user clicks a header, or when your program changes the sorting.
 
So pogram it that way. There's nothing stopping you from taking the same code that sorts the data when a header is clicked and using it when that property is set.
 
Associate a DataView object with your data set. DataView objects allow you to rearrange rows, thereby also sorting them.

Visual Basic:
myDataView.Sort = "LastName, FirstName DESC"
 
Back
Top