Salut,
J'ai fait une recherche dans le forum car j'avais déjà eu ce problème et la recherche m'avait aidé. Mais là je ne vois pas où est l'erreur?!
Je reconstruis bien mon datagrid à chaque fois.
Voici mon code :Y aurait-il d'autres paramètres que j'aurais oublié de regarder / configurer?
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
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 Protected WithEvents Liste As System.Web.UI.WebControls.DataGrid Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Call AffLst() End Sub Sub AffLst() Dim Ds() As DataRow Dim nbItem As Integer Liste.DataSource = ExtractDG() Liste.PageSize = 5 Ds = Selection.Select() If Ds.Length <> 0 Then nbItem = Ds(0).Table.Rows.Count Else nbItem = 0 End If If nbItem > Liste.PageSize Then Liste.AllowPaging = True Else Liste.AllowPaging = False End If Liste.DataBind() End Sub Private Sub Liste_PageIndexChanged(ByVal source As System.Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Liste.CurrentPageIndex = e.NewPageIndex Call AffLst() End Sub
Merci d'avance.
Partager