Datalist spacing

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

I have a Datalist that will display 4 columns of data.

I am not using a table format just labels to display a radio button and
label for the radio button.

Is there a way to set a size for the lable so that all the radio buttons
line up on top of each other? Right now they are flush next to each other
even if there is only 5 characters or 20 characters.

I have the datalist set as:

<asp:DataList ID="DataList1" RepeatColumns="4" width="100"
RepeatDirection="Horizontal" RepeatLayout="Flow" runat="server" >
<ItemTemplate> <vs:GroupRadioButton id="CvLetters"
runat="server" OnCheckedChanged="SelectCoverLetter_Click"
AutoPostBack="True" GroupName="CVRLettersGroup" />
<asp:label Id="CVLLabel" width="200px" text='<%#
Container.DataItem("CoverLetterTitle") %>' runat="server"/><asp:label
Id="CVLIDLabel" visible=false text='<%# Container.DataItem("CoverLetterID")
%>' runat="server"/>
</ItemTemplate>
<HeaderTemplate><br><b><u>CoverLetter(s) assigned to this
Resume</u></b><br> </HeaderTemplate>
<footertemplate><br></footertemplate>
</asp:DataList>

I tried setting the label width to 200px, but that didn't work. BTW the
vs:GroupRadioButton is just a radio button.

Thanks,

Tom
 
tshad said:
I have a Datalist that will display 4 columns of data.

I am not using a table format just labels to display a radio button and
label for the radio button.

Is there a way to set a size for the lable so that all the radio buttons
line up on top of each other? Right now they are flush next to each other
even if there is only 5 characters or 20 characters.

I have the datalist set as:

<asp:DataList ID="DataList1" RepeatColumns="4" width="100"
RepeatDirection="Horizontal" RepeatLayout="Flow" runat="server" >
<ItemTemplate> <vs:GroupRadioButton id="CvLetters"
runat="server" OnCheckedChanged="SelectCoverLetter_Click"
AutoPostBack="True" GroupName="CVRLettersGroup" />
<asp:label Id="CVLLabel" width="200px" text='<%#
Container.DataItem("CoverLetterTitle") %>' runat="server"/><asp:label
Id="CVLIDLabel" visible=false text='<%#
Container.DataItem("CoverLetterID") %>' runat="server"/>
</ItemTemplate>
<HeaderTemplate><br><b><u>CoverLetter(s) assigned to this
Resume</u></b><br> </HeaderTemplate>
<footertemplate><br></footertemplate>
</asp:DataList>

I tried setting the label width to 200px, but that didn't work. BTW the
vs:GroupRadioButton is just a radio button.

I also setting the ItemStyle-Width, but that didn't seem to do anything:

ItemStyle-Width="100px"

Tom
 
tshad said:
I also setting the ItemStyle-Width, but that didn't seem to do anything:

ItemStyle-Width="100px"

I also tried to use a table in the itemtemplate, but even though I told it
to repeat horizontal 4 times (which worked in the previous setup), it put
each table on top of each other instead of 4 across:

<asp:DataList ID="DataList2" RepeatColumns="4"
ItemStyle-Width="100px" RepeatDirection="Horizontal" RepeatLayout="Flow"
runat="server" >
<ItemTemplate>
<table width="20px">
<tr>
<td>
<vs:GroupRadioButton id="CvLetters" runat="server"
OnCheckedChanged="SelectCoverLetter_Click" AutoPostBack="True"
GroupName="CVRLettersGroup" />
<asp:label Id="CVLLabel" text='<%#
Container.DataItem("CoverLetterTitle") %>' runat="server"/><asp:label
Id="CVLIDLabel" visible=false text='<%# Container.DataItem("CoverLetterID")
%>' runat="server"/>
</td>
</tr>
</table>
</ItemTemplate>
<HeaderTemplate><br><b><u>All Stored Cover
Letters</u></b></HeaderTemplate>
</asp:DataList>

What am I doing wrong here?

Thanks,

Tom
 
Back
Top