<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

<telerik:RadGrid ID="RadGrid1" runat="server" CssClass="RadGrid" GridLines="None" wallowpaging="True" PageSize="20" AllowSorting="True" AutoGenerateColumns="False" ShowStatusBar="True" AllowAutomaticDeletes="True" AllowAutomaticUpdates="True" DataSourceID="SqlDataSource1" OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted" OnItemUpdated="RadGrid1_ItemUpdated" OnItemCommand="RadGrid1_ItemCommand" OnPreRender="RadGrid1_PreRender" CellSpacing="0" OnItemCreated="RadGrid1_ItemCreated" OnItemDataBound="RadGrid1_ItemDataBound"> <PagerStyle Mode="Slider" /> <ClientSettings> <ClientEvents OnRowDblClick="RowDblClick" /> </ClientSettings> <AlternatingItemStyle /> <MasterTableView CommandItemDisplay="Top" Name="Documents" AutoGenerateColumns="False" Width="100%" DataSourceID="SqlDataSource1" DataKeyNames="ID"> <DetailTables> <telerik:GridTableView DataKeyNames="ID" Name="Sections" DataSourceID="SqlDataSource2" runat="server"> <%-- Sql DataSource 3 --%> <DetailTables> <telerik:GridTableView DataKeyNames="ID" Name="Requirements" DataSourceID="SqlDataSource3"> <ParentTableRelation> <telerik:GridRelationFields DetailKeyField="DocumentSectionID" MasterKeyField="ID" /> </ParentTableRelation> <Columns> <telerik:GridBoundColumn DataField="ID" HeaderText="ID" SortExpression="ID" UniqueName="ID" Visible="false" FilterControlAltText="Filter Name column"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="DocNameReqID" SortExpression="DocNameReqID" FilterControlAltText="Filter Text column" HeaderText="ID" UniqueName="DocNameReqID"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Category" SortExpression="Category" FilterControlAltText="Filter Text column" HeaderText="Category" UniqueName="Category"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Text" SortExpression="Text" FilterControlAltText="Filter Text column" HeaderText="Text" UniqueName="Text"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Highlight" HeaderText="Highlight" SortExpression="Highlight" UniqueName="Highlight" Visible="false" FilterControlAltText="Filter Highlight column"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Keyword" SortExpression="Keyword" FilterControlAltText="Filter Text column" HeaderText="Keyword" UniqueName="Keyword"> </telerik:GridBoundColumn> <telerik:GridTemplateColumn> <ItemTemplate> <asp:ImageButton ID="ibtnEdit" runat="server" CommandName="EditRecord" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ID") %>' AlternateText="Edit" ImageUrl="~/Images/edit.gif" /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridButtonColumn ConfirmText="Delete this record?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="ID"> <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> </telerik:GridButtonColumn> </Columns> </telerik:GridTableView> </DetailTables> <%-- Sql DataSource 3 --%> <ParentTableRelation> <telerik:GridRelationFields DetailKeyField="DocumentID" MasterKeyField="ID" /> </ParentTableRelation> <Columns> <telerik:GridBoundColumn DataField="ID" HeaderText="ID" SortExpression="ID" UniqueName="ID" Visible="false" FilterControlAltText="Filter Name column"> </telerik:GridBoundColumn> <telerik:GridButtonColumn DataTextField="Name" HeaderText="Name" CommandName="RequirementLink" ButtonType="LinkButton"> </telerik:GridButtonColumn> <telerik:GridBoundColumn DataField="Text" SortExpression="Text" FilterControlAltText="Filter Text column" HeaderText="Req Description" UniqueName="Text"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="PageNo" SortExpression="PageNo" FilterControlAltText="Filter Text column" HeaderText="Page" UniqueName="Text"> </telerik:GridBoundColumn> <telerik:GridEditCommandColumn ButtonType="ImageButton" FilterControlAltText="Filter EditCommandColumn column"> </telerik:GridEditCommandColumn> <telerik:GridButtonColumn ConfirmText="Delete this record?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="ID"> <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> </telerik:GridButtonColumn> </Columns> <SortExpressions> <telerik:GridSortExpression FieldName="ID"></telerik:GridSortExpression> </SortExpressions> </telerik:GridTableView> </DetailTables> <Columns> <telerik:GridBoundColumn DataField="ID" HeaderText="ID" SortExpression="ID" UniqueName="ID" Visible="true" FilterControlAltText="Filter Name column"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="FileName" SortExpression="FileName" FilterControlAltText="Filter FileName column" HeaderText="File Name" UniqueName="FileName"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="DocFormat" FilterControlAltText="Filter DocFormat column" HeaderText="Format" SortExpression="DocFormat" UniqueName="DocFormat"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Size" FilterControlAltText="Filter Size column" HeaderText="Size (KB)" SortExpression="Size" UniqueName="Size" DataType="System.Double"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="TimeStamp" DataType="System.DateTime" FilterControlAltText="Filter TimeStamp column" HeaderText="Time Stamp" SortExpression="TimeStamp" UniqueName="TimeStamp"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="ParsedTime" DataType="System.DateTime" FilterControlAltText="Filter ParsedTime column" HeaderText="Parsed Time" SortExpression="ParsedTime" UniqueName="ParsedTime"> </telerik:GridBoundColumn> <telerik:GridEditCommandColumn ButtonType="ImageButton" FilterControlAltText="Filter EditCommandColumn column"> </telerik:GridEditCommandColumn> <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Download" Text="Download" ImageUrl="~/Images/download.png"> </telerik:GridButtonColumn> <telerik:GridButtonColumn ConfirmText="Delete this record?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="ID"> <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> </telerik:GridButtonColumn> </Columns> <EditFormSettings UserControlName="EmployeeDetailsCS.ascx" EditFormType="WebUserControl"> <EditColumn UniqueName="EditCommandColumn1"> </EditColumn> </EditFormSettings> </MasterTableView> <FilterMenu EnableImageSprites="False"> </FilterMenu> <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_WebBlue"> </HeaderContextMenu></telerik:RadGrid><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DocumentParsingConnectionString %>" SelectCommand="SELECT [ID],[Name], [FileName], [DocType], [DocFormat], [DocRefNo], [Title], [Size], [Version], [TimeStamp],[ParsedTime] FROM [Documents]" UpdateCommand="UPDATE [Documents] SET [Name] = @Name WHERE [ID]=@ID" DeleteCommand="DELETE FROM [Documents] WHERE [ID] = @ID" OldValuesParameterFormatString="original_{0}" ConflictDetection="OverwriteChanges"> <UpdateParameters> <asp:Parameter Name="Name" Type="String" /> <asp:Parameter Name="original_ID" Type="Int64" /> <asp:Parameter Name="original_Name" Type="String" /> </UpdateParameters> <DeleteParameters> <asp:Parameter Name="ID" Type="Int64" /> </DeleteParameters></asp:SqlDataSource><asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:DocumentParsingConnectionString %>" SelectCommand="SELECT [ID],[PageNo],[Name],SUBSTRING ([Text], 0 , 255 ) AS [Text] FROM [DocumentSections] WHERE DocumentID=@DocumentID" DeleteCommand="DELETE FROM [DocumentSections] WHERE [ID] = @ID"> <SelectParameters> <asp:SessionParameter SessionField="DocumentID" Name="DocumentID" Type="Int64" /> </SelectParameters> <DeleteParameters> <asp:Parameter Name="ID" Type="Int64" /> </DeleteParameters></asp:SqlDataSource><asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:DocumentParsingConnectionString %>" SelectCommand="SELECT [DocumentSections].[Name] + CONVERT(varchar(250), ROW_NUMBER() OVER (ORDER BY [Requirements].[ID])) AS DocNameReqID, [DocumentSections].[DocumentID] AS [DocumentID], [DocumentSections].[Name] AS [DocumentSectionName], [Requirements].[ID],[Requirements].[Category],[Requirements].[Text], [Requirements].[Keyword], [Requirements].[Highlight] FROM [Requirements] INNER JOIN [DocumentSections] ON [Requirements].[DocumentSectionID] = [DocumentSections].[ID] WHERE [Requirements].[DocumentSectionID]=@DocumentSectionID" DeleteCommand="DELETE FROM [Requirements] WHERE [ID] = @ID"> <SelectParameters> <asp:SessionParameter SessionField="DocumentSectionID" Name="DocumentSectionID" Type="Int64" /> </SelectParameters> <DeleteParameters> <asp:Parameter Name="ID" Type="Int64" /> </DeleteParameters></asp:SqlDataSource><table id="Table3" cellspacing="1" cellpadding="1" width="100%" border="0"> <tr> <td> </td> <td> </td> </tr> <tr> <td> Name: </td> <td> <asp:HiddenField ID="hfID" runat="server" Value='<%# DataBinder.Eval( Container, "DataItem.Name" ) %>'></asp:HiddenField> <asp:TextBox ID="TextBox7" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.Name" ) %>'> </asp:TextBox> </td> </tr> <tr> <td> FileName: </td> <td> <asp:TextBox ID="TextBox8" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.FileName") %>' TabIndex="1"> </asp:TextBox> </td> </tr> <tr> <td> DocType: </td> <td> <asp:TextBox ID="TextBox9" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.DocType") %>' TabIndex="2"> </asp:TextBox> </td> </tr> <tr> <td> DocFormat: </td> <td> <asp:TextBox ID="TextBox5" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.DocFormat") %>' TabIndex="2"> </asp:TextBox> </td> </tr> <tr> <td> DocRefNo: </td> <td> <asp:TextBox ID="TextBox10" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.DocRefNo") %>' TabIndex="2"> </asp:TextBox> </td> </tr> <tr> <td align="right" colspan="2"> <asp:Button ID="btnUpdate" Text="Update" runat="server" CommandName="Update" Visible='<%# !(DataItem is Telerik.Web.UI.GridInsertionObject) %>' onclick="btnUpdate_Click"> </asp:Button> <asp:Button ID="btnInsert" Text="Insert" runat="server" CommandName="PerformInsert" Visible='<%# DataItem is Telerik.Web.UI.GridInsertionObject %>'></asp:Button> <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button> </td> </tr></table>