private void data_Revenue_CellClick(object sender, DataGridViewCellEventArgs e) { int index = data_Revenue.CurrentCell.RowIndex; Oid = Convert.ToInt32(data_Revenue.Rows[index].Cells["id"].Value); Revenue branch = new Revenue(); branch = Revenue.SelectallObjectwithID(Oid); txt_money.Text = branch.money.ToString(); cbb_months.Text = branch.month; cbb_years.Text = branch.year; }