I am trying to add special days dynamically, I have set the template of the special day via aspx, and I am trying to assign it the dates with code on DayRender event. Thing is, it's not happening.
The aspx code goes:
<telerik:DayTemplate ID="DisableTemplate" runat="server">
<Content>
<div class="rcTemplate rcDayDisabled">
</div>
</Content>
</telerik:DayTemplate>
the css:
.RadCalendar_Special .rcRow .rcDayDisabled
{
background:0 0 no-repeat url(Disabled.gif);
}
the c#:
protected void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
{
if (e.Day.Date < DateTime.Now.Date)
{
RadCalendarDay RadDay = new RadCalendarDay();
RadDay.TemplateID = "DisableTemplate";
RadDay.Date = e.Day.Date;
e.Cell.CssClass = "rcDayDisabled";
RadCalendar1.SpecialDays.Add(RadDay);
}
}
also I noticed that without the property: Repeatable="DayInMonth" filled the special day will not appear... is there a solution to these problems:
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> <asp:Label ID="LabelAdmin" runat="server" Text="" /> <telerik:RadDockZone ID="RadDockZoneContentBlock1" runat="server" MinHeight="50px" MinWidth="100px" BorderStyle="None"> <telerik:RadDock ID="RadDockContentBlock1" runat="server" DockHandle="None" DefaultCommands="None" OnClientInitialize="SetHandleDock" DockMode="Docked"> <ContentTemplate> <div id="Handle_ctl00_ContentPlaceHolder1_RadDockContentBlock1" style="cursor: move;"> <uc1:ContentBlock ID="ContentBlock1" ContentID="1" runat="server" /> </div> </ContentTemplate> </telerik:RadDock> </telerik:RadDockZone></asp:Content>This is how my source page looks like
<telerik:RadGrid ID="radGridWrapper" runat="server" ShowHeader="false" BorderStyle="None" Width="100%" onexcelmlexportstylescreated="radGridWrapper_ExcelMLExportStylesCreated" onexcelmlexportrowcreated="radGridWrapper_ExcelMLExportRowCreated" > <MasterTableView Width="100%"> <ItemTemplate> <div id="id1" runat="server" style="width:800px;text-align:left; overflow:hidden;"> <telerik:RadGrid ID="RadGrid1" Width="100%" GridLines="Vertical" AllowPaging="true" PageSize="100" runat="server" AllowSorting="True" BackColor="white" Skin="Web20" onitemdatabound="RadGrid1_ItemDataBound" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true" HeaderStyle-Font-Names="Arial" onexcelmlexportstylescreated="RadGrid1_ExcelMLExportStylesCreated" HeaderStyle-Wrap="true" onneeddatasource="RadGrid1_NeedDataSource" OnItemCreated="RadGrid1_ItemCreated" OnSortCommand="RadGrid1_SortCommand" OnInsertCommand="RadGrid1_InsertCommand" ongridexporting="RadGrid1_GridExporting" onpdfexporting="RadGrid1_PdfExporting" onpageindexchanged="RadGrid1_PageIndexChanged"> <PagerStyle Mode="NumericPages" /> <ClientSettings > <Scrolling UseStaticHeaders="true" AllowScroll="true"/> </ClientSettings> <ItemStyle Font-Names="Arial" HorizontalAlign="Left" BackColor="white"></ItemStyle> <AlternatingItemStyle Font-Names="Arial" HorizontalAlign="Left" BackColor="white"/> <MasterTableView Width="100%"> </MasterTableView> </telerik:RadGrid> </div> </td> <%-- </div>--%> <tr> <td style="height: 72px"> <telerik:RadGrid ID="RadGrid2" Width="100%" GridLines="Vertical" Visible="false" runat="server" AllowSorting="True" Skin="Web20" AllowPaging="true" PageSize="100" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true" OnSortCommand="RadGrid2_SortCommand" HeaderStyle-Font-Names="Arial" onneeddatasource="RadGrid2_NeedDataSource" HeaderStyle-Wrap="true" onpageindexchanged="RadGrid2_PageIndexChanged"> <PagerStyle Mode="NumericPages" /> <ItemStyle Font-Names="Arial" HorizontalAlign="Left"></ItemStyle> <AlternatingItemStyle Font-Names="Arial" HorizontalAlign="Left" /> <MasterTableView Width="100%"> </MasterTableView> </telerik:RadGrid> <br /> </td> </tr> <%-- </div>--%> </ItemTemplate> </MasterTableView> </telerik:RadGrid>RadGrid radGrid = lbl_txt.Text == "All RadGrids" ? radGridWrapper : (RadGrid)radGridWrapper.Items[0].FindControl(lbl_txt.Text); //html.Visible = false; if (radGrid.Items.Count == 0) { Page.ClientScript.RegisterStartupScript(base.GetType(), "Alert", GC.Message("No records found")); return; } if (isExcelExport = true) { gridcaption = "<b style='color: blue; text-align: left;'>Effort Analysis Report </b>"; if (CheckBox4.Checked == true) { gridcaption += "<BR/>" + "<b>Process : </b>" + ddlprocess.SelectedItem.Text + " " + "|" + " " + "<b>Group : </b> " + ddlGroupby.SelectedItem.Text + " " + "|" + " " + "<b>From Date :</b>" + txtFromDate.Text + " " + "|" + " " + "<b>To Date :</b>" + txtToDate.Text; } radGrid.MasterTableView.Caption = gridcaption; radGrid.ExportSettings.FileName = "EffortAnalysis_" + "_from_" + txtFromDate.Text + "_to_" + txtToDate.Text; radGrid.ExportSettings.OpenInNewWindow = true; //radGrid.ExportSettings.IgnorePaging = true; //radGrid.ExportSettings.ExportOnlyData = true; gridBind(); radGrid.MasterTableView.ExportToExcel();Private Sub startNodeInEditMode(ByVal nodeValue As String) 'find the node by its Value and edit it when page loads Dim js As String = "Sys.Application.add_load(editNode); function editNode(){ " js += "var tree = $find(""" + ObjFoldersTree.ClientID + """);" js += "var node = tree.findNodeByValue('" + nodeValue + "');" js += "if (node) tree._startEdit(node); " js += "Sys.Application.remove_load(editNode);};" RadScriptManager.RegisterStartupScript(Page, Page.[GetType](), "nodeEdit", js, True) End Sub
Hi,
I am using RAD Grid and want to edit mode with some dropdown and textboxes.
I couldn’t able to push the values in to dropdown list . Since I am loading the data in code behind.
I am not using SqlDataSource in .aspx page. I am loading all the datas in code behind page.
Can you please help me on this issue?
Thanks in advance,
S. Murugesan