Hi Jessie,
Thank you for writing.
For the purpose, you should use the
DragDropService of RadListView. Here is a small example to get you started:
private
void
DragDropService_PreviewDragDrop2(
object
sender, RadDropEventArgs e)
{
if
(radPanorama1.ShowGroups)
{
TileGroupElement hoveredGroup = radPanorama1.ElementTree.GetElementAtPoint(e.DropLocation)
as
TileGroupElement;
if
(hoveredGroup !=
null
)
{
RadTileElement newTile =
new
RadTileElement();
newTile.Text = ((SimpleListViewVisualItem)e.DragInstance).Data.Text;
hoveredGroup.Items.Add(newTile);
//newTile.row
//newTile.Column
//newTile.RowSpan
//newTile.ColSpan
}
RadTileElement hoveredTile = radPanorama1.ElementTree.GetElementAtPoint(radPanorama1.PointToScreen(e.DropLocation))
as
RadTileElement;
if
(hoveredTile !=
null
)
{
TileGroupElement tileGroup = hoveredTile.FindAncestor<TileGroupElement>();
if
(tileGroup !=
null
)
{
RadTileElement newTile =
new
RadTileElement();
newTile.Text = ((SimpleListViewVisualItem)e.DragInstance).Data.Text;
tileGroup.Items.Add(newTile);
}
}
RadPanoramaElement hoveredControl = radPanorama1.ElementTree.GetElementAtPoint(radPanorama1.PointToScreen(e.DropLocation))
as
RadPanoramaElement;
if
(hoveredControl !=
null
)
{
RadTileElement newTile =
new
RadTileElement();
newTile.Text = ((SimpleListViewVisualItem)e.DragInstance).Data.Text;
hoveredControl.Items.Add(newTile);
}
}
else
{
RadTileElement newTile =
new
RadTileElement();
newTile.Text = ((SimpleListViewVisualItem)e.DragInstance).Data.Text;
radPanorama1.Items.Add(newTile);
}
}
I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.
Regards,
Stefan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the
Telerik Feedback Portal and vote to affect the priority of the items