Hi,
I'm using the ListBox control with the Scheduler one, so when the user drags an item with description from the ListBox and drops it into the scheduler a new appointment is created. I saw the Demo you provide, however, this one uses plain RadListDataItem and RadListVisualItem. On the description of each item there's a phone number. I have created a new "Add Appointment" form to hold the phone number. My Question is: how can I Drag&Drop ListBox Items with descriptions and retrieve not only the Item text but the description too?
I've tried the following code, but "item" is always null.
Thank you very much for your time and attention,
Matias.
I'm using the ListBox control with the Scheduler one, so when the user drags an item with description from the ListBox and drops it into the scheduler a new appointment is created. I saw the Demo you provide, however, this one uses plain RadListDataItem and RadListVisualItem. On the description of each item there's a phone number. I have created a new "Add Appointment" form to hold the phone number. My Question is: how can I Drag&Drop ListBox Items with descriptions and retrieve not only the Item text but the description too?
I've tried the following code, but "item" is always null.
Private
Sub
radListBox1_MouseMove(
ByVal
sender
As
Object
,
ByVal
e
As
MouseEventArgs)
If
e.Button <> MouseButtons.Left
Then
Return
End
If
If
Me
.isDragging
Then
Return
End
If
Dim
currentPosition
As
Point = e.Location
If
(Math.Abs(currentPosition.X -
Me
.mouseDownPosition.X) >= SystemInformation.DragSize.Width)
OrElse
(Math.Abs(currentPosition.Y -
Me
.mouseDownPosition.Y) >= SystemInformation.DragSize.Height)
Then
Me
.isDragging =
True
Dim
dragObject
As
New
DragObject()
Dim
item
As
DescriptionTextListVisualItem =
TryCast
(
Me
.LBox1.ElementTree.GetElementAtPoint(e.Location), DescriptionTextListVisualItem)
If
item IsNot
Nothing
Then
dragObject.Values.Add(AppointmentFields.Summary, item.Text)
dragObject.Values.Add(AppointmentFields.Description, item.DescriptionText)
dragObject.Status = AppointmentFields.Summary
TryCast(sender, RadListControl).DoDragDrop(dragObject, DragDropEffects.Copy)
End
If
End
If
End
Sub
Thank you very much for your time and attention,
Matias.