KaxTimeViewTimeStyle Property |
Namespace: Kettic.AspNet.Controls
[PersistenceModeAttribute(PersistenceMode.InnerProperty)] public virtual TableItemStyle TimeStyle { get; }
Use this property to provide a custom style for the items of the KaxTimeView control. Common style attributes that can be adjusted include foreground color, background color, font, and content alignment within the cell. Providing a different style enhances the appearance of the KaxTimeView control.
If you specify a red font for the TimeStyle property, all other item style properties in the KaxTimeView control will also have a red font. This allows you to provide a common appearance for the control by setting a single item style property. You can override the inherited style settings for an item style property that is higher in the hierarchy by setting its style properties. For example, you can specify a blue font for the AlternatingTimeStyle property, overriding the red font specified in the TimeStyle property.
To specify a custom style for the items of the KaxTimeView control, place the <TimeStyle> tags between the opening and closing tags of the KaxTimeView control. You can then list the style attributes within the opening <TimeStyle> tag.
You can also use the AlternatingTimeStyle property to provide a different appearance for the alternating items in the KaxTimeView control.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%@ Register Assembly="KaxCalendar.Net2" Namespace="Kettic.AspNetControls" TagPrefix="kaxCln" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <div> <asp:DropDownList AutoPostBack="true" ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"> <asp:ListItem Text="Select" Value=""></asp:ListItem> <asp:ListItem Text="DarkGray" Value="DarkGray"></asp:ListItem> <asp:ListItem Text="Khaki" Value="Khaki"></asp:ListItem> <asp:ListItem Text="DarkKhaki" Value="DarkKhaki"></asp:ListItem> </asp:DropDownList> </div> <kaxCln:KaxTimePicker ID="KaxTimePicker1" runat="server"> <TimePopupButton ImageUrl="clock.gif" HoverImageUrl="clock.gif" /> <TimeView Skin="None"> </TimeView> </kaxCln:KaxTimePicker> </div> </form> </body> </html>
using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class _Default : System.Web.UI.Page { protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { this.KaxTimePicker1.TimeView.TimeStyle.BackColor = System.Drawing.Color.FromName(this.DropDownList1.SelectedItem.Value); } }