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.

Recommended Answers

All 7 Replies

I still cannot figure dthis out

you can use Janus GridEX control.

What is it you don't understand?
Specify your problem!
Should I pamper you?

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);
        }
    }
}

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!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.