CheckBoxList Event Binding

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ARM8
    New Member
    • Jun 2013
    • 2

    CheckBoxList Event Binding

    Hi,

    I am dynamically binding a check box list, now i want to bind drop downs against each generated check box?

    How do I do this during the data bound event of check box list?

    Code:
    Private Sub chkColumnList_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkColumnList.DataBound
    
    	Dim cnt2 As Integer = chkColumnList.Items.Count
    	Dim tblDynamic = New Table()
    
    	For i As Integer = 1 To cnt2
    	    Dim tc = New TableCell()
    	    Dim tr = New TableRow()
    	    Dim ddlOrderby = New DropDownList()
    	    ddlOrderby.ID = "chkDynamicCheckBox" & i
    	    For x As Integer = 1 To cnt2
                  ddlOrderby.Items.Add(x.ToString)
    	    Next
    	    tc.Controls.Add(ddlOrderby)
    	    tr.Cells.Add(tc)
    	    tblDynamic.Rows.Add(tr)
    	Next
    	pnlOrderBy.Controls.Add(tblDynamic)
    
    End Sub
    Last edited by Frinavale; Jun 6 '13, 01:12 PM.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Could you please explain in more detail the purpose of your CheckBoxList and the purpose of your DropDownList?

    Also, what does a Table have to do with either of these controls?

    -Frinny

    Comment

    • ARM8
      New Member
      • Jun 2013
      • 2

      #3
      Hi have used a CheckBoxList which fetches all the columns name from the database. Now I need to place DropDownList beside each them to change their order number.

      For example, these DrownDownLists would contain all the column numbers if total number of is 10...it will have 1 to 10 numbers.
      Last edited by Frinavale; Jun 6 '13, 02:15 PM.

      Comment

      Working...