Ligne invisible dans une datagridview

Résolu
geralson - 22 mai 2013 à 13:35
 geralson - 22 mai 2013 à 15:24
Bonjour à tous, merci d'avance pour votre aide.
Je veux rendre invisible la ligne selectionnée de ma datagridview mais j'ai un souci avec mon code

1- Quand je fais ceci

dataGridView1.CurrentCell = null;
dataGridView1.SelectedRows[0].Visible = false;

Index was out of range. Must be non-negative and less than the size of the collection.

2- Quand je fais ceci

dataGridView1.SelectedRows[0].Visible = false;

Row associated with the currency manager's position cannot be made invisible.


Que dois-je faire. Merci à vous

1 réponse

merci c'est réglé


int k = dataGridView1.SelectedRows[0].Index;
dataGridView1.CurrentCell = null;
dataGridView1.Rows[k].Visible = false;
3
Rejoignez-nous