Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Placez ici le code utilisateur pour initialiser la page Dim Al As ArrayList = Session("CheckBox") 'Response.Write("Vous avez coché : ") ' 'For Each s As String In Al ' Response.Write("<li>" & s.Substring(5) & " </li>") 'Next ' 'Response.Write("") Dim Row As TableRow 'Cellule avec le texte selectionner Dim Cell1 As TableCell '1er drop Dim Cell2 As TableCell Dim Drop2 As DropDownList '2eme drop Dim Cell3 As TableCell Dim drop3 As DropDownList For Each s As String In Al Row = New TableRow Cell1 = New TableCell Cell1.Controls.Add(New LiteralControl(s.Substring(5))) Drop2 = New DropDownList Drop2.ID = "Drop2" & s.Substring(5) Drop2.DataSource = Split("Support1,Support2,Support3", ",") Drop2.AutoPostBack = True AddHandler Drop2.SelectedIndexChanged, AddressOf Drop2_SelectedIndexChanged Drop2.DataBind() Cell2 = New TableCell Cell2.Controls.Add(Drop2) Row.Cells.Add(Cell1) Row.Cells.Add(Cell2) Table1.Rows.Add(Row) Next Table1.DataBind() End Sub Private Sub Drop2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Response.Write(CType(sender, DropDownList).ID.Substring(5)) 'pour l'instant je sais pas comment ajouter une cellule avec le drop 'mais je pense que je vais partir d'ici, en rajoutant un cellule au tableau ... End Sub
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Placez ici le code utilisateur pour initialiser la page If Not Page.IsPostBack Then DropDownList1.DataSource = Split("10*15,13*18,casquette", ",") DropDownList1.DataBind() DropDownList1_SelectedIndexChanged(New Object, New EventArgs) DropDownList2_SelectedIndexChanged(New Object, New EventArgs) End Sub Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged Select Case DropDownList1.SelectedValue Case "10*15" DropDownList2.DataSource = Split("brillant,mat", ",") Case "13*18" DropDownList2.DataSource = Split("brillant,mat", ",") Case "casquette" DropDownList2.DataSource = Split("L,XL,XXL", ",") End Select DropDownList2.DataBind() End Sub Private Sub DropDownList2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList2.SelectedIndexChanged Select Case DropDownList1.SelectedValue Case "10*15" Select Case DropDownList2.SelectedValue Case "brillant" DropDownList3.DataSource = Split("Valeur1,Valeur2", ",") Case "mat" DropDownList3.DataSource = Split("Valeur1,Valeur2", ",") End Select Case "13*18" Select Case DropDownList2.SelectedValue Case "brillant" DropDownList3.DataSource = Split("Valeur1,Valeur2", ",") Case "mat" DropDownList3.DataSource = Split("Valeur1,Valeur2", ",") End Select Case "casquette" Select Case DropDownList2.SelectedValue Case "L" DropDownList3.DataSource = Split("Valeur1,Valeur2", ",") Case "XL" DropDownList3.DataSource = Split("Valeur1,Valeur2", ",") Case "XXL" DropDownList3.DataSource = Split("Valeur1,Valeur2", ",") End Select End Select DropDownList2.DataBind() DropDownList3.DataBind() End Sub
Dim Al As ArrayList = Session("CheckBox") Dim Row As TableRow 'Cellule avec le texte selectionner Dim Cell1 As TableCell '1er drop Dim Cell2 As TableCell Dim Drop2 As DropDownList '2eme drop Dim Cell3 As TableCell Dim drop3 As DropDownList For Each s As String In Al Row = New TableRow Cell1 = New TableCell Dim Ligne As New RecupCheckcboxControle Ligne = LoadControl("RecupCheckcboxControle.ascx") Ligne.ID = s.Substring(5) Cell1.Controls.Add(Ligne) Row.Cells.Add(Cell1) Table1.Rows.Add(Row) Next Table1.DataBind()