Link to home
Start Free TrialLog in
Avatar of ASPNet_Learner
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()
ASKER CERTIFIED SOLUTION
Avatar of devlab2012
devlab2012
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ASPNet_Learner
ASPNet_Learner

ASKER

I added  Width="266px" for <asp:CheckBoxList> but still it is doing same
SOLUTION
Avatar of Rajar Ahmed
Rajar Ahmed
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Data table is populated from a select SQL. Number of rows in the dataset may vary for me to use
chkLst.RepeatColumns = 2

I already have the RepeaterDirection=Horizontal in the properties window of the checkboxlist.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It was prob. with my CSS file, thank for the help.