Click here to Skip to main content
15,851,387 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
Hello all! I'm trying to create a seamless grid view to display data within my C# application. I want to be able to see the numbers on top of my background image- no gridlines or boxes, etc. Just the number display.

Any ideas?

I appreciate your time in advance,

Dusty
Posted
Updated 20-Sep-10 16:30pm
v2
Comments
Sunasara Imdadhusen 21-Sep-10 1:29am    
Which platform (Windows or Web) you want to use?
Praveen Nair (NinethSense) 22-Sep-10 10:00am    
Play with properties?
yesotaso 24-May-11 17:28pm    
Source: http://www.urbandictionary.com/define.php?term=seamless
Seamless (noun) - Used to describe a situation where everyone is told it will work perfectly, when in fact it's an unmitigated clusterfuck.

Right-click on DataGridView control, click "Properties", find "CellBorderStyle" and set to "None" ... see if that takes care of it.
 
Share this answer
 
Funny thing I came across this question today as I am currently working on an A* variation Grid-Search to teach my students next week... Just for testing purposes I made a WinForm with a FlowLayoutPanel control that was 400 x 400 and divided it into and 8x8 Grid resulting in a 50x50 Cell.

I then wrote the following code to populate the panel.
C#
protected List<string> Colors;
protected Color RandomColor()
{
    Color ret;
    /* Truncated Code */
    return ret;
}
private void Form1_Load(object sender, EventArgs e)
{
    Colors = new List<string>();
    Grid8x8.Margin = new System.Windows.Forms.Padding(0);
    Grid8x8.Padding = new System.Windows.Forms.Padding(0);
    Grid8x8.BorderStyle = BorderStyle.FixedSingle;

    Initialize();
}
private void Initialize()
{
    Colors.Clear();
    Grid8x8.Controls.Clear();
    int i;
    for (i = 0; i < 64; i++)
    {
        cell = new Label();
        cell.Text = i.ToString();
        cell.AutoSize = false;
        cell.BorderStyle = BorderStyle.None;
        cell.TextAlign = ContentAlignment.MiddleCenter;
        cell.Width = 50;
        cell.Height = 50;
        cell.Margin = new System.Windows.Forms.Padding(0);

        currentColor = RandomColor();
        previousColor = currentColor;

        cell.BackColor = currentColor;
        Grid8x8.Controls.Add(cell);
        Colors.Add(currentColor.ToString());
    }
}


Since the List is 0-based index instead of a multi-dimensional array its safe to say that if X == CurrentCellIndex then X + 8 will equal the Cell Directly below the CurrentCellIndex.

Hope this helps,

-ArtificerGM
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900