This is a migrated thread and some comments may be shown as answers.

RadDataLayout label cursor

2 Answers 116 Views
DataEntry
This is a migrated thread and some comments may be shown as answers.
Alex Dybenko
Top achievements
Rank 2
Alex Dybenko asked on 14 Feb 2020, 08:38 AM

Hi,

i would like to change cursor for data field label in RadDataLayout, to make it work as hyperlink, I set it font as below, but can't find any cursor property, is it possible?

Private Sub RadDataLayout1_ItemInitialized(sender As Object, e As Telerik.WinControls.UI.DataLayoutItemInitializedEventArgs)

            Dim ci As DataLayoutControlItem = e.Item
            e.Item.Font = New System.Drawing.Font(e.Item.Font.Name, e.Item.Font.Size, FontStyle.Underline)

end sub

Thanks

Alex

2 Answers, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 18 Feb 2020, 02:29 PM

Hello Alex,

Currently, due to the specifics of RadDataLayout control, it is not possible to change the cursor when the mouse hovers the label that shows the data field. The reason is that this control contains a specific DataLayoutControlItem that hosts the labels and controls within itself and can not be easily accessed and modified.

However, I can suggest you to consider using the RadDataEntry control. It has a similar look and feel as RadDataLayout, excluding the customize dialog that enables a transformation of the control`s layout at run time. In RadDataEntry control, you can access the label from the Panel.Controls collection and you will be able to change the mouse cursor as you want. Please refer to the following code snippet:

Private Sub RadDataEntry1_ItemInitialized(ByVal sender As Object, ByVal e As ItemInitializedEventArgs)
    If e.Panel.Controls.Count = 0 Then
        Return
    End If

    Dim label As RadLabel = TryCast(e.Panel.Controls(1), RadLabel)

    If label IsNot Nothing Then
        label.Font = New System.Drawing.Font(label.Font.Name, label.Font.Size, FontStyle.Underline)
        label.Cursor = Cursors.Hand
        label.Click += Me.Label_Click
    End If
End Sub

I hope this will be useful. Please let me know if you have additional questions.

Regards,
Nadya
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Alex Dybenko
Top achievements
Rank 2
answered on 19 Feb 2020, 06:47 AM

Thanks Nadya,

but I have already switched from RadDataEntry to RadDataLayout due to other feature...

Ok, not a big deal with this mouse cursor

Alex

Tags
DataEntry
Asked by
Alex Dybenko
Top achievements
Rank 2
Answers by
Nadya | Tech Support Engineer
Telerik team
Alex Dybenko
Top achievements
Rank 2
Share this question
or