Bonjour,
j'essaye de renseigné un datagrid mais le refresh n'a aucune incidence.
déclaration de mon style et de mon datagrid associé au style
j'ai donc à l'affichage un datagrid nomméCode:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 ' Déclaration du style Dim DGSTY As DataGridTableStyle = New DataGridTableStyle DGSTY.MappingName = _Data_Grid.DT_ListeOV.TableName ' Déclaration des colonnes ' 1ère Dim dgCsty As DataGridColumnStyle = New DataGridTextBoxColumn() dgCsty.MappingName = "CODCDE" dgCsty.Width = 50 dgCsty.HeaderText = "Code" DGSTY.GridColumnStyles.Add(dgCsty) ' 2ième Dim dgCsty2 As DataGridColumnStyle = New DataGridTextBoxColumn() dgCsty2.MappingName = "ETAT" dgCsty2.Width = 50 dgCsty2.HeaderText = "Etat" DGSTY.GridColumnStyles.Add(dgCsty2) ' Affectation du style au datagrid dg_ListeOV.TableStyles.Add(DGSTY)
après je renseigne ma tableCitation:
dg_ListeOV
et là, leCode:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 Dim DR As DataRow DR = _Data_Grid.DT_ListeOV.NewRow() DR("CODCDE") = 222222 DR("ETAT") = "test 2" _Data_Grid.DT_ListeOV.Rows.Add(DR) _Data_Grid.DT_ListeOV.AcceptChanges() dg_ListeOV.Refresh() DR = _Data_Grid.DT_ListeOV.NewRow() DR("CODCDE") = 333333 DR("ETAT") = "test 3" _Data_Grid.DT_ListeOV.Rows.Add(DR) _Data_Grid.DT_ListeOV.AcceptChanges() dg_ListeOV.Refresh()
ne fait rien?Citation:
dg_ListeOV.Refresh()
ni plantage ni rien d'autre.
du coup, à l'affichage, mon datagrid est vide.
pourquoi ? quelqu'un a t'il une idée ?