private void dataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { //var dataIndexNo = dataGridView1.Rows[e.RowIndex].Index.ToString(); //string cellValue = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); //string cellValue1 = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString(); //Convert.ToDateTime(cellValue); //var epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); ///////////////////////////////////////////////////// //edited below code if goves error undo it //int_data= Convert.ToInt64((Convert.ToDateTime(cellValue) - GlobalClass.origin).TotalSeconds); GlobalClass.start_date = Convert.ToInt64((Convert.ToDateTime(dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString()) - GlobalClass.origin).TotalMilliseconds); //int_data = Convert.ToInt64((Convert.ToDateTime(cellValue1) - GlobalClass.origin).TotalSeconds); GlobalClass.end_date = Convert.ToInt64((Convert.ToDateTime(dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString()) - GlobalClass.origin).TotalMilliseconds); user_option uo = new user_option(); uo.Show(); this.Hide(); //MessageBox.Show(Convert.ToString(GlobalClass.start_date) + " " + Convert.ToString(GlobalClass.end_date)); //MessageBox.Show(Convert.ToString(int_data)); //MessageBox.Show("the row data is: "+ cellValue+" "+cellValue1); //"The row index = " + dataIndexNo.ToString() + " and }
private void button3_Click(object sender, EventArgs e) { user_option u = new user_option(); u.Show(); this.Hide(); }