this telerik article을 빨리 읽은 후 끌어서 놓기가 제대로 작동하는 것 같습니다.
<telerik:RadTreeView ... EnableDragAndDrop="true" OnNodeDrop="MyTreeView_NodeDrop">
는 EnableDragAndDrop 및 OnNodeDrop 작동을 얻기에 두 개의 중요한 조각을 것 같다,하지만 당신은 시도 속성 목록에 없었다. HTH 이제
뒤에 코드에서 당신은
this.treeView1.AddHandler(RadDragAndDropManager.DropQueryEvent, new EventHandler<DragDropQueryEventArgs>(OnDropQuery), true);
이가 그런
private void OnDropQuery(object sender, DragDropQueryEventArgs e)
{
RadTreeViewItem destinationItem = e.Options.Destination as RadTreeViewItem;
object source = this.GetItemFromPayload<object>(e.Options.Payload);
object target = destinationItem != null ? destinationItem.Item : null;
DropPosition position = destinationItem != null ? destinationItem.DropPosition : DropPosition.Inside;
if (source != null && target != null)
{
Section sourceSection = source as Section;
Section targetSection = target as Section;
Question sourceQuestion = source as Question;
Question targetQuestion = target as Question;
if (sourceQuestion != null)
{
try
{
if (sourceQuestion != null && targetQuestion != null && object.ReferenceEquals(sourceQuestion, targetQuestion))
{
sourceSection.Questions.Remove(sourceQuestion);
targetSection.Questions.Add(sourceQuestion);
e.QueryResult = false;
return;
}
if (targetQuestion != null && position == DropPosition.Inside)
{
sourceSection.Questions.Remove(sourceQuestion);
targetSection.Questions.Add(sourceQuestion);
e.QueryResult = false;
return;
}
if (position != DropPosition.Inside && targetQuestion == null)
{
sourceSection.Questions.Remove(sourceQuestion);
targetSection.Questions.Add(sourceQuestion);
e.QueryResult = false;
return;
}
}
catch (Exception ex)
{
}
}
}
else
{
e.QueryResult = false;
return;
}
e.QueryResult = true;
}
이다 생성자
에서 이벤트를
를 해고해야
더 많은 관련 정보를 제공해 주시겠습니까? –