using System.Drawing;
using Telerik.WinControls.UI;

namespace TelerikWinFormsApp5
{
    public partial class RadForm1 : Telerik.WinControls.UI.RadForm
    {
        public RadForm1()
        {
            const int TIME_COL_WIDTH = 45;
            const int PLAN_COL_WIDTH = 50;
            const int ROW_HEIGHT = 20;

            InitializeComponent();

            gvTimeTable.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.None;

            gvTimeTable.TableElement.RowHeaderColumnWidth = TIME_COL_WIDTH;
            gvTimeTable.ShowRowHeaderColumn = true;
            gvTimeTable.TableElement.CurrentRowHeaderImage = null;
            gvTimeTable.TableElement.TableHeaderHeight = ROW_HEIGHT;
            gvTimeTable.TableElement.RowHeight = ROW_HEIGHT;

            gvTimeTable.MultiSelect = true;

            GridViewDataColumn aCol = new GridViewTextBoxColumn ( );
            aCol.HeaderText = "Col 1";
            aCol.TextAlignment = ContentAlignment.MiddleCenter;
            aCol.Width = PLAN_COL_WIDTH;
            gvTimeTable.Columns.Add ( aCol );

            aCol = new GridViewTextBoxColumn ( );
            aCol.HeaderText = "Col 2";
            aCol.TextAlignment = ContentAlignment.MiddleCenter;
            aCol.Width = PLAN_COL_WIDTH;
            gvTimeTable.Columns.Add ( aCol );

            for ( int i = 1; i <= 20; i++ )
            {
                GridViewRowInfo aRow = gvTimeTable.Rows.AddNew ( );
                aRow.Cells [ 0 ].Value = i;
                aRow.Cells [ 1 ].Value = i * 100;
            }

            gvTimeTable.Width = 100;
            gvTimeTable.Height = 100;
            gvTimeTable.AutoSize = true;

            gvTimeTable.SelectionMode = GridViewSelectionMode.CellSelect;
            gvTimeTable.MultiSelect = true;
        }
    }
}
