Try
Select Case e.MenuItem.Text.ToLower
Case "delete"
e.Node.Remove()
statusLabel.Text =
"You deleted " & e.Node.Text
' save the changes
Case "move up"
'move the selected node one place up
'here's what we're gonna do:
'Check if this node is already at the top
'If not, switch it with the node directly above him, same goes for moving the node down...
If Not e.Node.Value = e.Node.ParentNode.Nodes(0).Value Then
Dim i As Integer = 0
While i < e.Node.ParentNode.Nodes.Count
If e.Node.Value = e.Node.ParentNode.Nodes(i).Value Then
'Because of the i-value, we are going to 'walk' through the
'second layer of the tree (radtreeview1.nodes(0).nodes)
'This part is a bit nasty programming, first we remove the node before the node we want to move
'our nodeclicked is now automatically moving one place up,
'than we insert the removed node one place under the moved node
'et voila
Dim tempNode As New Telerik.Web.UI.RadTreeNode
tempNode = e.Node.ParentNode.Nodes(i - 1)
m_RadTreeFolderHierarchy.Nodes(0).Nodes.RemoveAt(i - 1)
m_RadTreeFolderHierarchy.Nodes(0).Nodes.Insert(i, tempNode)
End If
i += 1
End While
End If
Case "move down"
'move the selected node one place down
If Not e.Node.Value = e.Node.ParentNode.Nodes(e.Node.ParentNode.Nodes.Count - 1).Value Then
Dim i As Integer = 0
While i < e.Node.ParentNode.Nodes.Count
If e.Node.Value = e.Node.ParentNode.Nodes(i).Value Then
'Because of the i-value, we are going to 'walk' through the
'second layer of the tree (radtreeview1.nodes(0).nodes)
'This part is a bit nasty programming, first we remove the node AFTER the node we want to move
'our nodeclicked is now automatically moving one place down,
'than we insert the removed node one place ABOVE the moved node
'et voila
Dim tempNode As New Telerik.Web.UI.RadTreeNode
tempNode = e.Node.ParentNode.Nodes(i + 1)
m_RadTreeFolderHierarchy.Nodes(0).Nodes.RemoveAt(i + 1)
m_RadTreeFolderHierarchy.Nodes(0).Nodes.Insert(i, tempNode)
Exit While
End If
i += 1
End While
End If
End Select
treeview_SaveChanges()
Catch ex As Exception

aResource =
new ResourceType("Calendar Color");
aResource.DataSource = GetColors(); // a DataTable with 7 colors and 1 column - "Color"
aResource.KeyField =
"Color";
aResource.TextField =
"Color";
aResource.ForeignKeyField =
"RadSchedulerColor"; // the field in the Scheduler datasource containing 1 of the 7 color values
theScheduler.ResourceTypes.Add(aResource);
The problem is that I want to add new resources with different controls, like a checkbox or a radiobutton. Then I want to be able to set the value based on the Scheduler's datasource. Currently this does not link to the Scheduler so the resource has no default value. I tried to override the OnFormCreated method:
void theScheduler_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
{
if (e.Container.Mode == SchedulerFormMode.AdvancedInsert || e.Container.Mode == SchedulerFormMode.AdvancedEdit)
{
DropDownList colors = (DropDownList)e.Container.FindControl("Calendar Color");
colors.SelectedValue =
"Red";
colors.Width =
new Unit(100, UnitType.Percentage);
}
}
This only increased the width, it doesn't set the SelectedValue. Am I doing this right? Is what I'm trying to do possible without creating a custom UserControl with aspx elements?