Hi,
I am doing a Resturant Reservation System and i am thinking of doing a schedule of the tables that are reserved as shown below.

_______|08.00| 08.30| 09.00| 09.30|
table1
_______
table2
_______
table3
_______
table4
_______
table5
_______
.
.
.

I tried to use datagrid view but i couldn't figure out how to do it.. Help pls.

Edited 5 Years Ago by xanawa: n/a

you can use Janus GridEX control.

do u have an idea where can i download this control pls?

Try a DataGridView control, you don't have to download it. It is there ready for you to use.
I reworked my basic gridview example so it fits more to your "needs"
Just start a new forms app and fill in the code where needed.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DataGridTableReservation
{
    public partial class Form1 : Form
    {
        // Make datgridview for table reservations
        private DataGridView ReservationDG;

        public Form1()
        {
            InitializeComponent();
            // Instantiate the grid 
            ReservationDG = new DataGridView();
            // Init the grid
            ReservationDG.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            ReservationDG.Location = new System.Drawing.Point(29, 35);
            ReservationDG.Name = "ReservationDG";
            ReservationDG.Size = new System.Drawing.Size(240, 150);
            ReservationDG.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
            
            ReservationDG.ColumnCount = 4;
            ReservationDG.Columns[0].Name = "08:00";
            ReservationDG.Columns[1].Name = "08:30";
            ReservationDG.Columns[2].Name = "09:00";
            ReservationDG.Columns[3].Name = "09:30";

            ReservationDG.Rows.Add(5); // or: ReservationDG.RowCount = 5;
            for (int i = 0; i < 5; i++)
            {              
                ReservationDG.Rows[i].HeaderCell.Value = "table" + (i+1).ToString();               
            }
            Controls.Add(ReservationDG);
        }
    }
}

Edited 5 Years Ago by ddanbe: n/a

Try a DataGridView control, you don't have to download it. It is there ready for you to use.
I reworked my basic gridview example so it fits more to your "needs"
Just start a new forms app and fill in the code where needed.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DataGridTableReservation
{
    public partial class Form1 : Form
    {
        // Make datgridview for table reservations
        private DataGridView ReservationDG;

        public Form1()
        {
            InitializeComponent();
            // Instantiate the grid 
            ReservationDG = new DataGridView();
            // Init the grid
            ReservationDG.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            ReservationDG.Location = new System.Drawing.Point(29, 35);
            ReservationDG.Name = "ReservationDG";
            ReservationDG.Size = new System.Drawing.Size(240, 150);
            ReservationDG.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
            
            ReservationDG.ColumnCount = 4;
            ReservationDG.Columns[0].Name = "08:00";
            ReservationDG.Columns[1].Name = "08:30";
            ReservationDG.Columns[2].Name = "09:00";
            ReservationDG.Columns[3].Name = "09:30";

            ReservationDG.Rows.Add(5); // or: ReservationDG.RowCount = 5;
            for (int i = 0; i < 5; i++)
            {              
                ReservationDG.Rows[i].HeaderCell.Value = "table" + (i+1).ToString();               
            }
            Controls.Add(ReservationDG);
        }
    }
}

aaa thanks sooooo much! :-) i spent 3 days on this and couldn't figure it out thanks alot for your help!!

This article has been dead for over six months. Start a new discussion instead.