Hi there.
I am using the TreeView and trying to implement the drag and drop functionality for reordering. I have setup the NodeDrop event as per the documentation using e.SourceDragNode and e.DestDragNode. The DestDragNode works fine however the SourceDragNode always seems to return null.
Setup is as follows ...
ASPX...
<
telerik:RadTreeView ID="treeMenu" runat="server" DataTextField="Text" DataValueField="Value"
AllowNodeEditing="True" EnableDragAndDrop="True" EnableViewState="True"
EnableDragAndDropBetweenNodes="True" OnNodeDrop="treeMenu_NodeDrop"
CheckBoxes="True" >
<CollapseAnimation Type="OutQuint" Duration="100"></CollapseAnimation>
<ExpandAnimation Duration="100"></ExpandAnimation>
</telerik:RadTreeView>
C#...
protected
void treeMenu_NodeDrop(object sender, RadTreeNodeDragDropEventArgs e)
{
RadTreeNode sourceNode = e.SourceDragNode;
RadTreeNode destNode = e.DestDragNode;
RadTreeViewDropPosition dropPosition = e.DropPosition;
if (destNode != null)
{
if (sourceNode.TreeView.SelectedNodes.Count <= 1)
{
PerformDragAndDrop(dropPosition, sourceNode, destNode);
}
else if (sourceNode.TreeView.SelectedNodes.Count > 1)
{
foreach (RadTreeNode node in sourceNode.TreeView.SelectedNodes)
{
PerformDragAndDrop(dropPosition, node, destNode);
}
}
destNode.Expanded = true;
sourceNode.TreeView.ClearSelectedNodes();
}
}
private
static void PerformDragAndDrop(RadTreeViewDropPosition dropPosition, RadTreeNode sourceNode, RadTreeNode destNode)
...
Please can someone help me to understand why this is happening???
many thanks
| e.SeriesItem.Label.TextBlock.Text = row("Lehrstuhl") + " - " + String.Format("#%", row("Minuten")) |
| <radc:RadChart ID="RadChartq" runat="server" Margins-Bottom="125px" Margins-Left="10%" |
| Margins-Right="10%" Width="800px" Palette="Gradient" Height="500px"> |
| <Gridlines> |
| <VerticalGridlines Visible="False" /> |
| <HorizontalGridlines Color="DarkGray" /> |
| </Gridlines> |
| <YAxis MaxValue="65"> |
| <Label ShadowColor="180, 0, 0, 0" TextFont="Arial, 10pt"> |
| </Label> |
| </YAxis> |
| <XAxis AutoScale="False" DataLabelsColumn="hour_start" MaxItemsCount="24" LabelRotationAngle="-70" |
| ValueFormat="ShortTime"> |
| <Label ShadowColor="180, 0, 0, 0" TextFont="Arial, 10pt"> |
| </Label> |
| </XAxis> |
| <Legend VAlignment="Top" VSpacing="40"> |
| <Background BorderColor="144, 144, 144" FillStyle="Solid" MainColor="White" /> |
| </Legend> |
| <Background BorderColor="Gray" FillStyle="Gradient" MainColor="Silver" SecondColor="White" |
| BorderWidth="1" Corners-RoundSize="6" /> |
| <PlotArea BorderColor="" Corners-BottomLeft="Round" Corners-BottomRight="Round" Corners-RoundSize="6" |
| Corners-TopLeft="Round" Corners-TopRight="Round" /> |
| <ChartTitle HorPadding="10" HSpacing="10" ShadowColor="180, 0, 0, 0" TextColor="White" |
| TextFont="Arial, 16px" > |
| <Background FillStyle="Solid" /> |
| </ChartTitle> |
| <EmptySeriesMessage ShadowColor="180, 0, 0, 0" TextColor="Red" TextFont="Arial, 12pt"> |
| </EmptySeriesMessage> |
| </radc:RadChart> |
| DataSet dsData = new WebServices().METHOD(); |
| Font labelFont = new Font("Arial", 9, GraphicsUnit.Pixel); |
| ChartSeries Series1 = this.RadChart1.CreateSeries("TITLE..", Color.Empty, ChartSeriesType.Bar); |
| Series1.LabelAppearance.TextColor = Color.DarkSlateGray; |
| Series1.LabelAppearance.Alignment = ContentAlignment.TopCenter; |
| Series1.LabelAppearance.TextFont = labelFont; |
| Series1.LabelAppearance.RotationAngle = -90; |
| Series1.LabelAppearance.VerPadding = 5; |
| Series1.LineWidth = 2; |
| Series1.MainColor = Color.Green; |
| foreach (DataRow row in dsData.Tables[0].Rows) |
| { |
| ChartSeriesItem item = new ChartSeriesItem(); |
| item.XValue = ((DateTime)row["hour_start"]).ToLocalTime().ToOADate(); |
| item.YValue = Convert.ToDouble(row["ROWS"]); |
| Series1.Items.Add(item); |
| } |
<
script language="javascript" type="text/javascript">
function popupUploadForm()
{ disableLeaveWarning();
var url=imageUploadForm;
var oWnd = $find("<%= radwinPopup.ClientID %>");
oWnd.show();
oWnd.setSize(600,550);
oWnd.setUrl(url);
oWnd.Center();
oWnd.add_close(OnClientClose);
return false; }
</script>
<radW:RadWindowManager ID="radwinPopupMgr" runat="server" Height="550" Width="600" Modal="true" Behavior="Close"><Windows>
<radW:RadWindow ID="radwinPopup" ReloadOnShow="true" VisibleStatusBar="false" Behavior="Close" BackColor="gray" Modal="true" runat="server"/></Windows></radW:RadWindowManager>