or
// necessary to disable the weekends on client-side navigation |
function OnDayRender(calendarInstance, args) { |
// convert the date-triplet to a javascript date |
// we need Date.getDay() method to determine |
// which days should be disabled (e.g. every Saturday (day = 6) and Sunday (day = 0)) |
var jsDate = new Date(args._date[0], args._date[1] - 1, args._date[2]); |
if (jsDate.getDay() == 0 || jsDate.getDay() == 6) { |
var otherMonthCssClass = "otherMonth_" + calendarInstance.Skin; |
args.Cell.className = otherMonthCssClass; |
// replace the default cell content (anchor tag) with a span element |
// that contains the processed calendar day number -- necessary for the calendar skinning mechanism |
args.Cell.innerHTML = "<span>" + args._date[2] + "</span>"; |
// disable selection and hover effect for the cell |
args.Cell.DayId = ""; |
} |
} |
<telerik:RadDatePicker ID="Raddatepicker2" Style="vertical-align: middle;" Skin="Office2007" Width="200px" |
MinDate="2009-01-01" runat="server" MaxDate="2099-12-16" Culture="Dutch (Netherlands)"> |
<DateInput onclick="ToggleSecondPopup()" DateFormat="d" runat="server"></DateInput> |
<Calendar DayNameFormat="FirstTwoLetters" FirstDayOfWeek="Monday" runat="server" OnDayRender="Calendar_OnDayRender" Skin="Office2007" DisabledDayStyle-ForeColor="Gray"> |
<ClientEvents OnDayRender="OnDayRender" /> |
</Calendar> |
</telerik:RadDatePicker> |
protected void Page_Load(object sender, EventArgs e) |
{ |
if(!Page.IsPostBack) |
{ |
} |
if(!IsAlreadyLoaded) |
{ |
Raddatepicker2.Calendar.SpecialDays.Clear(); |
Raddatepicker2.SelectedDate = DateTime.Now; |
FullPage(); |
FullUpdate(); |
IsAlreadyLoaded = true; |
} |
} |
protected void Calendar_OnDayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e) |
{ |
if(e.Day.Date.DayOfWeek == DayOfWeek.Saturday || e.Day.Date.DayOfWeek == DayOfWeek.Sunday) |
{ |
string calendarSkin = Raddatepicker2.Calendar.Skin != "" ? Raddatepicker2.Calendar.Skin : "Default"; |
string otherMonthCssClass = String.Format("otherMonth_{0}", calendarSkin); |
e.Cell.Text = ""; |
e.Cell.CssClass = otherMonthCssClass; |
Label label = new Label(); |
label.Text = e.Day.Date.Day.ToString(); |
e.Cell.Controls.Add(label); |
RadCalendarDay calendarDay = new RadCalendarDay(); |
calendarDay.Date = e.Day.Date; |
calendarDay.IsSelectable = false; |
calendarDay.ItemStyle.CssClass = otherMonthCssClass; |
Raddatepicker2.Calendar.SpecialDays.Add(calendarDay); |
} |
} |
<
telerik:RadTreeView
ID
=
"RadTreeView1"
runat
=
"server"
EnableDragAndDrop
=
"True"
OnNodeDrop
=
"RadTreeView1_HandleDrop"
EnableDragAndDropBetweenNodes
=
"true"
BackColor
=
"White"
>
GridItemEventArgs
e, property Item, if it's a GridEditFormItem). If I try to find the label or textbox control that I want to disable, I can find them and set their visibility fine. But if I try giving an Id to the Tr table row tag, or to a div that I wrap around that tag, and try FindControl with the id of those controls, item.FindControl does not find the control. I want to disable the entire table row, not just the controls in that row. How can I do that?
Thanks!