private void DateTimePickerCreation_ValueChanged(object sender, EventArgs e) { DateTimePicker dtp = (DateTimePicker)sender; dtp.NullableValue(dtp.Value); RefreshOffreSelectioned(); }
public async void RefreshOffreSelectioned() { Region region = (Region)comboBoxRegion.SelectedItem; Contrat contrat = (Contrat)comboBoxContrat.SelectedItem; Poste poste = (Poste)comboBoxPoste.SelectedItem; Intervalle intervalle = new Intervalle(dateTimePickerCreationStart.NullableValue(), dateTimePickerCreationEnd.NullableValue()); // Fix Bug out of Range exception offreSource.DataSource = null; try { var t = controller.GetOffres(new FiltersOffreRequest(region, contrat, poste, intervalle)); await t; offreSource.DataSource = t.Result; } catch { } if (dataGridViewOffre.RowCount > 0) { this.dataGridViewOffre.Columns["Id"].Visible = false; } compteur.Text = dataGridViewOffre.RowCount.ToString(); }