GridViewControl

This is a discussion on GridViewControl within the C# Programming forums, part of the General Programming Boards category; I am using a "GridViewControl" with 14 columns and with this code below I can set the number "1" to ...

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    383

    GridViewControl

    I am using a "GridViewControl" with 14 columns and with this code below I can set the number "1" to the First Column and 21 Rows down.
    What I wonder is how I access for example column 3 and row 1 or column 4 and row 2 etc...
    What is the way/syntax to do this ?
    I am not sure wich one of all column.. members to use here.

    Code:
    String^ Numbers = "1";
    
    for( int i = 0; i < 20; i++)
    {
    	MainResultGrid->Rows->Add(Numbers);
    }

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    I can't really make out what you're asking, but if you're trying to access the cell at a specific row and column you could use something this:
    Code:
    int Row = 12;
    int Column = 34;
    dataGridView1.Rows[Row].Cells[Column].Value = "Hello";
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    383
    Great thanks, that was exactly what I was looking for and it works fine.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21