$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
How to Put up Column and Row Headers of Calendar Using C#
Home > How to > Calendar Column and Row Headers

Kettic ASP.NET AJAX UI library is dedicated to offering users the most comprehensive user interface creating and setting controls, including calendar components. In this page, we focus on how to set calendar raw and column headers as well as customize headers' appearance within C#.NET project.
Main contents of Kettic asp.net calendar column and raw headers settings tutorial page:
  • C# codes on how to set raw header
  • C# codes on how to set column header
  • C# codes on how to set headers' appearance

How to Use C# Codes to Set Row Header

Before move to following sample C# codes to set raw header, we need to be familiar with the basic concept of ShowRowHeaders property. With this property, we can add and display row headers on the calendar. If the row header is in number mode, we can change numbers that appear in the row headers with text and image by setting RowHeaderText and RowHeaderImage properties. When we choose text type and assign a value to the RowHeaderText property, there will appear same text label in every row on the web calendar. When we choose image type and assign a value to the RowHeaderImage property, every row on the asp.net calendar is labeled by the image.

PerCalendar1.ShowRowHeaders = true;
PerCalendar1.RowHeaderText = "row";

How to Use C# Codes to Set Column Header

The concept of column header is similar with that of raw header: we can add and display row headers on the asp.net calendar by using ShowRowHeaders property controls. The calendar column headers include three properties: number, text and image. If the column header is in number mode, we are capable of replacing and changing numbers that appear in the row headers with text and image by setting RowHeaderText and RowHeaderImage properties.

PerCalendar1.ShowColumnHeaders = true;
PerCalendar1.DayNameFormat = DayNameFormat.FirstTwoLetters;

How to Use C# Codes to Set Header Appearance

Besides setting the row and column headers' properties, we still can customize and define the headers' style, back & fore colors, border styles, border color, border width and header font. C# codes below are for setting and specifying these attributes and a sample image is appended.

columnandrowheadersimage.png

PerCalendar1.HeaderStyle.BackColor = System.Drawing.Color.LightGreen;
PerCalendar1.HeaderStyle.BorderStyle = BorderStyle.Solid;
PerCalendar1.HeaderStyle.BorderColor = System.Drawing.Color.Blue;
PerCalendar1.HeaderStyle.BorderWidth = 2;
PerCalendar1.HeaderStyle.Width = 30;
PerCalendar1.HeaderStyle.Font.Italic = true;
ASP.NET AJAX UI Controls