Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VB.NET Create two column CheckboxList

Tags:

asp.net

vb.net

My below code pulls in 100 items into the checkboxlist all into one column. How can I modify the code so it will appear as two columns? Thanks!

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If Not Page.IsPostBack Then
        Dim di As New IO.DirectoryInfo(ImagePath)
        Dim imageArray As IO.FileInfo() = di.GetFiles()
        Dim image As IO.FileInfo

        'list the names of all images in the specified directory

        For Each image In imageArray.OrderBy(Function(i) i.Name)
            CheckBoxList1.Items.Add(image.Name)
        Next
    End If
End Sub
like image 883
Bruno Avatar asked Oct 19 '11 15:10

Bruno


1 Answers

Try something like:

<asp:checkboxlist id="CheckBoxList1" runat="server" RepeatLayout="table" RepeatColumns="2" RepeatDirection="vertical"/>
like image 111
geekchic Avatar answered Sep 26 '22 21:09

geekchic