Bonjour à tous,
Vu ma question... inutile de vous rappeler que je suis débutant...
Voila mon problème...
J'ai dans un datagridview un certain nombre de colonnes, La troisième colonne affiche une date. Ce que j'aimerai c'est pouvoir récupérer la date sous la forme dd/mm/yyyy dans un label. Sachons que j'ai réussi, mais l'affichage de la date est sous cette forme (dd/mm/yyyy 00:00:00) j'aimerai bien enlever 00:00:00 et merci d'avance
voici mon code source
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { int NumLigne = dataGridView1.CurrentRow.Index; textBox4.Text = dataGridView1.Rows[NumLigne].Cells[0].Value.ToString(); label2.Text = dataGridView1.Rows[NumLigne].Cells[1].Value.ToString(); textBox1.Text = dataGridView1.Rows[NumLigne].Cells[2].Value.ToString(); label12.Text = dataGridView1.Rows[NumLigne].Cells[3].Value.ToString(); label16.Text = dataGridView1.Rows[NumLigne].Cells[4].Value.ToString(); label17.Text = dataGridView1.Rows[NumLigne].Cells[5].Value.ToString(); label18.Text = dataGridView1.Rows[NumLigne].Cells[6].Value.ToString(); label19.Text = dataGridView1.Rows[NumLigne].Cells[7].Value.ToString(); }
Partager