]Hello I'm working on a project in where I need to print out the header cells dynamically along with the entire 1st row[0] and 1st column[0] dynamically . right now I got it to print from zero to what ever size the sequence in the rows and columns but I have like three zeros in row[0,0].
Also I have to put a zero in the front of both my arrays to get that box to show a zero and then the rest of my elements in both arrays sequentially. I wanna know how I can just program that zero into that first box automatically and then have element zero in my first array (witch prints out the row)start printing at row [0], column[1] and my second array (which prints out the column) print element[0] at column [0], row [1].. see right know I have to do this to both my array's string[] rowArray={"0","G","T","C"} string[] columnArray={"0","G","T","C"} see how I have to put that zero in the beginning

also I'm trying to add the value of like the cell left of the current cell to a declared int value
like if im in the third cell over in row 1, I want to add the value of the cell to the left of that (cell number 2) to like a value of 1 (so basically I want to add a cell value from a different coordinate and add it to a number and the print that value in a empty cell)

this is what I have in my code so far
Code:
 
public partial class Form1 : Form
    {
        int index;
        int i;//columns
        int j;//rows
        int match = 1;
        int mismatch = 0;
        int gapPenalty = -1;
        int len = 1;
        int fillRow;
        int fillColumn;
        string[] seq1 = {"0","G","G","T","C","A"};//columns
        string[] seq2 = {"0","G","C","A","T"};//rows
        public Form1()
        {
            InitializeComponent();
        }
        
        
            private void Form1_Load(object sender, EventArgs e)
            {
 
            }
            private void button1_Click(object sender, EventArgs e)
            {
 
                dataGridView1.ColumnCount=seq1.Length;
                dataGridView1.RowCount = seq2.Length;
                dataGridView1.Rows[0].Cells[0].Value = 0;
              int l=0;
                for(i=0; i<seq1.Length; i++)
                {
                    dataGridView1.Rows[0].Cells[i].Value += l.ToString();
                    dataGridView1.Columns[i].Name += seq1[i] ;
                   
                    l--;
                }
                
              int k=0;
                    for (j = 0; j < seq2.Length; j++)
                        {
                            dataGridView1.Rows[j].Cells[0].Value += k.ToString();
                                dataGridView1.Rows[j].HeaderCell.Value += seq2[j];
                               k--;
                            }
                           }
and this is the part of my code I tried to create the second part of my question with
(The adding a cell value with a number and printing the value in a empty cell)
as you can see the logic is totally flaw and right now I only got it to print out -1 in all the empty cells
its filling the columns and rows dynamically and the reason i have fillColumn-- cuase I though the -- would take the focus one cell back thus taking that value and then adding it to another value and the printing it in the cell to the right of it one by one
Code:
 
private void button2_Click(object sender, EventArgs e)
            {   
               
               /* int lval = fillColumn--;
                int tval = fillRow--;
                int dval1 = fillRow-- + fillColumn--;
                
 
                int left = gapPenalty + lval;
                int top = gapPenalty + tval;
                int diagnl = match + dval1;
                int diagnl2 = mismatch + dval1;
                int L, T, D1, D2;
                for (fillRow = 1; fillRow < seq2.Length; fillRow++)
                {
                    for (fillColumn = 1; fillColumn < seq1.Length; fillColumn++)
                    {
                        object lValue = dataGridView1[fillColumn - 1, fillRow].Value;
                        object tValue = dataGridView1[fillColumn, fillRow - 1].Value;
                           object dValue = dataGridView1[fillColumn - 1, fillRow - 1].Value;
                        if (left > top || left > diagnl || left > diagnl2)
                        {
                     
                            if (int.TryParse(lValue.ToString(), out L))
                            {
                                dataGridView1[fillColumn, fillRow].Value = left;
                            }
 
                        }
                        
                     else if (top > left || top > diagnl || top > diagnl2)
                        {
                            if (int.TryParse(tValue.ToString(), out T))
                            {
                                dataGridView1[fillColumn, fillRow].Value = top;
                            }
                        }
                    else if (diagnl > left || diagnl > top)
                            {
                                if (int.TryParse(dValue.ToString(), out D1))
                                {
                                    dataGridView1[fillColumn, fillRow].Value = diagnl;
                                }
                            }
                        else if (diagnl2 > left || diagnl2 > top)
                            {
                                if (int.TryParse(dValue.ToString(), out D2))
                                {
                                    dataGridView1[fillColumn, fillRow].Value = diagnl2;
                                }
                            }
                        }
                    }*/
I'd appreciate any help I can get
and thank you in advance
and heres a screen shot of it just with the first rows and columns with the opening characters in the cells
notice the three zeros
Name:  Untitled.png
Views: 176
Size:  37.4 KB
and here a shoot after I try to get it to add the first cell left of the empty cell to a number and the print the value in that empty cell
as you can see all I get are -1's
Name:  Untitled1.png
Views: 135
Size:  28.1 KB