<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
></
telerik:RadAjaxLoadingPanel
>
<
telerik:RadAjaxPanel
ID
=
"RadAjaxPanel"
runat
=
"server"
>
<
telerik:RadTreeView
ID
=
"RadTreeView1"
runat
=
"server"
Width
=
"100%"
OnNodeExpand
=
"RadTreeView1_NodeExpand"
LoadingStatusPosition
=
"BeforeNodeText"
OnNodeClick
=
"RadTreeView1_NodeClick"
>
</
telerik:RadTreeView
>
</
telerik:RadAjaxPanel
>
Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
LoadRootNodes(RadTreeView1, TreeNodeExpandMode.ServerSideCallBack)
End Sub
Private Shared Sub LoadRootNodes(ByVal treeView As RadTreeView, ByVal expandMode As TreeNodeExpandMode)
Dim RootNode As New RadTreeNode()
RootNode.Text =
"Guest"
RootNode.Value =
"1"
RootNode.ExpandMode = expandMode
treeView.Nodes.Add(RootNode)
End Sub
Protected Sub RadTreeView1_NodeExpand(ByVal sender As Object, ByVal e As RadTreeNodeEventArgs)
PopulateNodeOnDemand(e, TreeNodeExpandMode.ServerSideCallBack)
End Sub
Private Shared Sub PopulateNodeOnDemand(ByVal e As RadTreeNodeEventArgs, ByVal expandMode As TreeNodeExpandMode)
For i As Integer = 1 To 10
Dim childNode As New RadTreeNode
childNode.Text = i.ToString
childNode.Value = i.ToString
e.Node.Nodes.Add(childNode)
Next
e.Node.Expanded = True
End Sub
Protected Sub RadTreeView1_NodeClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs)
Dim str As String = e.Node.Value
End Sub
<
telerik:GridButtonColumn
UniqueName
=
"Edit"
ButtonType
=
"ImageButton"
ImageUrl
=
"../../Images/Edit.png"
Display
=
"true"
Text="<%$Resources:Caption,Edit%>" HeaderButtonType="PushButton">
</
telerik:GridButtonColumn
>
Hello,
When i click on column header of the radcalendar it selects all the days of week for that month, ie. When i click on 'W' then it selects all the Wednesdays for that month. But what i want is when i click on 'W' then it should select all the Wednesdays for an entire date range (range i have set using rangemindate and rangemaxdate span across 10 months) after asking a confirmation
For this i have done the following
string day = "Wednesday"; // i am setting this value dynamically through client side OnColumnHeaderClick
for (DateTime date = rangeStart; date.CompareTo(rangeEnd) < 1; date = date.AddDays(1))
{
if (day == Enum.GetName(typeof(DayOfWeek), date.DayOfWeek))
{
RadDate rd = new RadDate(date);
radCalendarAM.SelectedDates.Add(rd);
}
}
This works perfectly when selecting dates. Now if i click on the same column header again i want to remove all the "wednesdays" for the entire date range. To remove i have done the following
DayOfWeek dow = (DayOfWeek)Enum.Parse(typeof(DayOfWeek), day);
for (int i = 0; i < radCalendarAM.SelectedDates.Count; i++)
{
RadDate date = (RadDate)radCalendarAM.SelectedDates[i];
if (date.Date.DayOfWeek == dow)
{
radCalendarAM.SelectedDates.RemoveAt(i);
}
}
But this code does'nt remove all the Wednesdays in the date range, it leave behind alternate wednesdays (or which ever day) selected.
Can you advice on this?
-thanks