private void updateDataGridView(string name = null, string type = null) { dtCalendar = null; dtCalendar = Gtools.ToDataTable <GoogleCaledar>(GoogleCalendarAPIV3.listCalendar()); dgvCalendar.DataSource = dtCalendar; //dgvCalendar.Rows.Clear(); //foreach(GoogleCaledar item in GoogleCalendarAPIV3.listCalendar()) //{ // dgvCalendar.Rows.Add(new string[] { item.}) //} }
private void btnConnect_Click(object sender, EventArgs e) { if (cbUser.SelectedIndex == -1) { MessageBox.Show("You have to Select A User in order to connect", "Attention!!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { if (GoogleCalendarAPIV3.GoogleCalendarConnection( UserList[cbUser.SelectedIndex].clientSecretPath, UserList[cbUser.SelectedIndex].userName)) { btnConnect.BackColor = Color.Green; updateDataGridView(); } else { btnConnect.BackColor = Color.Red; MessageBox.Show("Connection Error", "Attention!!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } }