Bonjour,
J'aimerais savoir s'il y a un moyen de pouvoir accéder à la empty template d'une gridview dans l'évenement Load de la page, j'ai essayé tous les codes que j'ai trouvé sur le net, mais aucun ne propose veritablement l'accès par le Page _Load. J'ai éssayé mais
Voici une idée de tt ce que j'ai éssayé
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
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim cbofr, cboba As New DropDownList
        Dim txtfr, txtba As New TextBox
        If Page.IsPostBack = False Then
            If grvFraisProforma.Rows.Count = 0 Then
                'cbofr.Page = sender
                'Dim rw As GridViewRow = DirectCast(cbofr.Page.NamingContainer, GridViewRow)
                'cbofr = CType(rw.FindControl("cboFraisInsert"), Dropdownlist)
                'cboba = CType(rw.FindControl("cboBaseFrais"), Dropdownlist)
                'MsgBox(grvFraisProforma.Rows.Count.ToString)
                cbofr = CType(grvFraisProforma.Rows(0).FindControl("cboBaseFrais"), DropDownList)
            Else
                cbofr = CType(grvFraisProforma.FooterRow.FindControl("cboFraisInsert"), DropDownList)
                cboba = CType(grvFraisProforma.FooterRow.FindControl("cboBaseFrais"), DropDownList)
            End If
            txtfr = cbofr.Controls.Item(0)
            txtba = cboba.Controls.Item(0)
            txtfr.Attributes.Add("onChange", "selUnite(document.getElementById('" & cbofr.UniqueID & "'), document.getElementById('" & cboba.UniqueID & "'), document.getElementById('" & txtba.UniqueID & "'));")
        End If
 
    End Sub
Je compte sur la communauté
merci à tous