send updates in Datagridview while datagrid_selectionchanged

Hi, In form1 i have a textbox and what to updates the coordinates when  selectionchanged even triggered.

But i  didn't received updates whenever selection change. Please do assis.
namespace Circuits
    class DataGrid : DataGridView 
        int[] Location_of_gird = new int[2] { 35, 50 };
        int [] Size_of_grid = new int[2]{622,622};
        int Col_row_count = 10;
        int row_height = 62;
        int col_width = 62;
        int [] e_Index =new int[2];

        public void DataGridInitialize()
            this.ColumnCount = Col_row_count;
            this.RowCount = Col_row_count;
            this.AutoSize = false;
            this.DefaultCellStyle.SelectionBackColor = Color.GreenYellow;
            this.GridColor = Color.White;
            this.BorderStyle = BorderStyle.Fixed3D;
            this.CellBorderStyle = DataGridViewCellBorderStyle.None;

            this.Location = new Point(Location_of_gird[0], Location_of_gird[1]);

            this.Size = new Size(Size_of_grid[0], Size_of_grid[1]);

            this.ColumnHeadersVisible = false;
            this.RowHeadersVisible = false;

            foreach (DataGridViewRow row in this.Rows)
                row.Height = row_height;

            foreach (DataGridViewColumn col in this.Columns)
                col.Width = col_width;

        public void eventDataGridView()
            this.DoubleClick += new EventHandler(DataGrid_DoubleClick);
            this.Click += new EventHandler(DataGrid_Click);
            this.SelectionChanged += new EventHandler(DataGrid_SelectionChanged);

        void   DataGrid_SelectionChanged(object sender, EventArgs e)
            e_Index[0] = this.CurrentCell.RowIndex;
            //System.Diagnostics.Debug.Print( "e_index[0] --> " + e_Index[0] + "\n");
            e_Index[1] = this.CurrentCell.ColumnIndex;
            //System.Diagnostics.Debug.Print("e_index[1] --> " + e_Index[1] + "\n");

        void DataGrid_Click(object sender, EventArgs e)
            //throw new NotImplementedException();

        void DataGrid_DoubleClick(object sender, EventArgs e)

        public int Index_coordinates(int i)
            return (e_Index[i]);

namespace Circuits
    public partial class Form1 : Form
        DataGrid DG1;
        public Form1()
            DG1 = new DataGrid();
            txtCood.Text = DG1.Index_coordinates(0) + "  " + DG1.Index_coordinates(1);

        private void Form1_Load(object sender, EventArgs e)

Open in new window

Rama TitoProgrammerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Debug the code and make sure that eventDataGridView() is being called (i.e. set a breakpoint there)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rama TitoProgrammerAuthor Commented:
hi, i did manage to solve. thanks for the advice
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.