Autor Beitrag
tomycat
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 265
Erhaltene Danke: 1



BeitragVerfasst: Mo 21.08.17 20:06 
hallo,
ich habe dataGridView8, mit dem Kopf "dataGridView8 laden" wird dataGridView8 gefüllt.
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
for (int i = 0; i < dataGridView7.Rows.Count - 1; i++)
{
    dataGridView8.Rows.Add(dataGridView7.Rows[i].Cells[0].Value.ToString(),
                           dataGridView7.Rows[i].Cells[2].Value.ToString(),
                           dataGridView7.Rows[i].Cells[1].Value.ToString(),
                           dataGridView7.Rows[i].Cells[7].Value.ToString(),
                           dataGridView7.Rows[i].Cells[6].Value.ToString(),
                           dataGridView7.Rows[i].Cells[8].Value.ToString(),
                           dataGridView7.Rows[i].Cells[9].Value.ToString(),
                           dataGridView7.Rows[i].Cells[10].Value.ToString());
}


Wenn ich vor der schleife...
ausblenden C#-Quelltext
1:
dataGridView8.Items.Clear()					

... setze wird Items rot unterstrichen.

ausblenden Fehler
1:
2:
Fehler  CS1061  "DataGridView" enthält keine Definition für "Items", und es konnte keine Items-Erweiterungsmethode gefunden werden,
die ein erstes Argument vom Typ "DataGridView" akzeptiert (möglicherweise fehlt eine using-Direktive oder ein Assemblyverweis).


Moderiert von user profile iconTh69: Beitragsformatierung überarbeitet.
Ralf Jansen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 4700
Erhaltene Danke: 991


VS2010 Pro, VS2012 Pro, VS2013 Pro, VS2015 Pro, Delphi 7 Pro
BeitragVerfasst: Mo 21.08.17 20:34 
Die Elemente in einem DataGridView heißen Rows (hast du ja auch schon so benutzt) und nicht Items.

Für diesen Beitrag haben gedankt: tomycat
tomycat Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 265
Erhaltene Danke: 1



BeitragVerfasst: Mi 23.08.17 11:08 
ausblenden C#-Quelltext
1:
dataGridView8.Rows.Clear() // ist die Lösung :-)