ASPNet_Learner
asked on
How align text of checkboxlist control in ASP.Net?
I want text in my checkbox list to align right to the checkbox. Somehow it is not align to the right, it is being displayed in the bottom, did i miss something?
----------------
<asp:CheckBoxlist ID="chkLst" runat="server" TextAlign="Right"
AutoPostBack="True" ></asp:CheckBoxlist>
-----------------
I am populating my list items programmatically from the dataset
-----------------
Dim Row As DataRow
If Not DS Is Nothing Then
If DS.Tables.Count > 0 Then
If DS.Tables(0).Rows.Count > 0 Then
For Each Row In DS.Tables(0).Rows
Dim li As New ListItem()
li.Text = Row("NAME").ToString.Trim
chkLst.Items.Add(li)
chkLst.TextAlign = TextAlign.Right
Next
End If
End If
End If
DS.Dispose()
----------------
<asp:CheckBoxlist ID="chkLst" runat="server" TextAlign="Right"
AutoPostBack="True" ></asp:CheckBoxlist>
-----------------
I am populating my list items programmatically from the dataset
-----------------
Dim Row As DataRow
If Not DS Is Nothing Then
If DS.Tables.Count > 0 Then
If DS.Tables(0).Rows.Count > 0 Then
For Each Row In DS.Tables(0).Rows
Dim li As New ListItem()
li.Text = Row("NAME").ToString.Trim
chkLst.Items.Add(li)
chkLst.TextAlign = TextAlign.Right
Next
End If
End If
End If
DS.Dispose()
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Data table is populated from a select SQL. Number of rows in the dataset may vary for me to use
chkLst.RepeatColumns = 2
chkLst.RepeatColumns = 2
ASKER
I already have the RepeaterDirection=Horizont al in the properties window of the checkboxlist.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It was prob. with my CSS file, thank for the help.
ASKER