I need to know when the user click on the RowHeader in the DataGrid control.
I have look at the RowHeaderClick event and OnRowHeaderClick metod.
But they are Protected, in I am not allowed to use them. Is there a solution?
Hi,
>I need to know when the user click on the RowHeader in the DataGrid
>control.
Add an eventhandler for DataGrid click event, then add this code:
private void dataGrid1_Click(object sender, System.EventArgs e)
{
DataGrid.HitTestInfo hti = dataGrid1.HitTest( dataGrid1.PointToClient(
Control.MousePosition ) );
if ( hti.Type == DataGrid.HitTestType.RowHeader )
{
Console.WriteLine( "Row Header Click - RowNr = {0}", hti.Row );
}
}
HTH,
Greetings
> I have look at the RowHeaderClick event and OnRowHeaderClick metod.
>
> But they are Protected, in I am not allowed to use them. Is there a
> solution?
Terje Myklebust - 23 Aug 2005 09:43 GMT
Thanks Bart, it solve my problem.
But it also makes a new.
Clicking on the column header to sort the data. Is there a way to know that
the sort operation is done.
The click event comes before the sort. I will like to know when the sort is
done, so I can take the datarow on top and do something with the data.