Suz,
Try subclassing the DataGrid and override OnMouseEnter method. It the column
is of Type LinkLabelColumn then change the cursor style. This is what I did
for the Look a like linkLabel in my inherited DataGrid.
protected override void OnMouseMove(MouseEventArgs e){
DataGrid.HitTestInfo hti = HitTest(e.X, e.Y);
switch (hti.Type)
{
case DataGrid.HitTestType.Cell:
if
(TableStyles[0].GridColumnStyles[hti.Column].GetType().Name.Equals("LinkLabelColumn"))
{
this.Cursor = Cursors.Hand;
}
else
{
this.Cursor = Cursors.Arrow;
}
break;
}
}
>I am creating a linklabel look-a-link in a datagrid with the following code
> by overriding the paint sub:
[quoted text clipped - 29 lines]
>
> Thanks!
Suz - 31 Mar 2005 23:25 GMT
Hi Madhavi!
Thank you! It works ..... would you happen to know how I can interrigate the
contents of the cell to find out if it is blank or has a value. If it is
blank, then I do no want it to have a hand cursor.
The screen looks something like this
FileID
Date Owner Project
Date Owner Project
So that every row in the FileID column has a 'linklabelcolumn'. The cursor
is a hand over the whole FileID column. I think that if I can find the
value in the in the cell, then I can change the cursor style based on the
contents of the cell.
Again, thank you!
> Suz,
>
[quoted text clipped - 68 lines]
> >
> > Thanks!
Suz - 31 Mar 2005 23:25 GMT
Hi Madhavi!
Thank you! It works ..... would you happen to know how I can interrigate the
contents of the cell to find out if it is blank or has a value. If it is
blank, then I do no want it to have a hand cursor.
The screen looks something like this
FileID
Date Owner Project
Date Owner Project
So that every row in the FileID column has a 'linklabelcolumn'. The cursor
is a hand over the whole FileID column. I think that if I can find the
value in the in the cell, then I can change the cursor style based on the
contents of the cell.
Again, thank you!
> Suz,
>
[quoted text clipped - 68 lines]
> >
> > Thanks!
Suz - 31 Mar 2005 23:25 GMT
Hi Madhavi!
Thank you! It works ..... would you happen to know how I can interrigate the
contents of the cell to find out if it is blank or has a value. If it is
blank, then I do no want it to have a hand cursor.
The screen looks something like this
FileID
Date Owner Project
Date Owner Project
So that every row in the FileID column has a 'linklabelcolumn'. The cursor
is a hand over the whole FileID column. I think that if I can find the
value in the in the cell, then I can change the cursor style based on the
contents of the cell.
Again, thank you!
> Suz,
>
[quoted text clipped - 68 lines]
> >
> > Thanks!
Suz - 31 Mar 2005 23:25 GMT
Hi Madhavi!
Thank you! It works ..... would you happen to know how I can interrigate the
contents of the cell to find out if it is blank or has a value. If it is
blank, then I do no want it to have a hand cursor.
The screen looks something like this
FileName
DateDone Owner Project
DateDone Owner Project
So that every row in the FileName column has a 'linklabelcolumn'. The cursor
is a hand over the whole FileName column. I think that if I can find the
value in the in the cell, then I can change the cursor style based on the
contents of the cell.
Again, thank you!
> Suz,
>
[quoted text clipped - 68 lines]
> >
> > Thanks!
Suz - 01 Apr 2005 00:15 GMT
Madhavi!
I got it all working. Below is my modified code. Thanks so much for your
help. Sorry for the repeated posts. I get getting a bad verb error and didn't
realize my post was actually posting!
Private Sub dgMain_MouseMove( _
ByVal sender As Object, _
ByVal e As MouseEventArgs)
' **********************************
Dim hti As DataGrid.HitTestInfo = dgMain.HitTest(e.X, e.Y)
Select Case hti.Type
Case DataGrid.HitTestType.Cell
If
dgMain.TableStyles(0).GridColumnStyles(hti.Column).GetType.Name.Equals("DataGridColoredLinkLabel") Then
If dgMain.Item(hti.Row, hti.Column).ToString() <> "" Then
Me.Cursor = Cursors.Hand
Else
Me.Cursor = Cursors.Arrow
End If
Else
Me.Cursor = Cursors.Arrow
End If
End Select
End Sub
> Hi Madhavi!
>
[quoted text clipped - 86 lines]
> > >
> > > Thanks!
Madhavi - 01 Apr 2005 17:48 GMT
This was exactly what I was working on last week. So I could help you help
you.
Happy coding!!
Madhavi
> Madhavi!
>
[quoted text clipped - 132 lines]
>> > >
>> > > Thanks!