ASP.NET: CheckBoxList specify number of columns
How do I specify that I want two columns on a checkboxlist? Below is my code:
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("\\bk00app0001\Images\")
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
CheckBoxList1.Items.Add(image.Name)
Next
End If
End Sub
Protected Sub btnDelete_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnDelete.Click
For count As Integer = 0 To CheckBoxList1.Items.Count - 1
开发者_JAVA技巧If CheckBoxList1.Items(count).Selected Then
File.Delete("\\bk00app0001\Images\" & CheckBoxList1.Items(count).ToString)
CheckBoxList1.Items.Remove(count)
End If
Next
Response.Redirect("Delete.aspx")
End Sub
Set CheckBoxList.RepeatDirection
and CheckBoxList.RepeatColumns
as you require.
精彩评论