Solved

asp.net datalist align columns

Posted on 2009-04-07
2
816 Views
Last Modified: 2012-08-13
Is there a setting to align columns in a data list?
I actually have a nested datalist so that I can group on a certain field. I have the columns set to 2, but, some rows column alignment is different than others (from group to group).

thanks for looking and your suggestions
alan
0
Comment
Question by:avoorheis
2 Comments
 
LVL 14

Accepted Solution

by:
amar31282 earned 500 total points
ID: 24091486
0
 

Author Comment

by:avoorheis
ID: 24093921
here it is...I was at work when I posted
        <asp:DataList ID="DataList3" runat="server" DataSourceID="SqlDataSource1" DataKeyField="region" BackColor="White" BorderStyle="Solid" Width="100%" >

            <ItemTemplate>

                <asp:Label ID="regionLabel" runat="server" Text='<%# Eval("region") %>' BackColor="#8080FF" Width="100%"></asp:Label>

                <asp:DataList ID="DataList4" runat="server" DataSourceID="SqlDataSource2" DataKeyField="region" RepeatDirection="Horizontal" RepeatColumns="2" 

                                BackColor="White" BorderStyle="Solid" CellSpacing="10" >

                    <ItemTemplate>

                        <asp:Label ID="WIDNAMLabel" runat="server" Text='<%# Eval("WIDNAM") %>'></asp:Label><br />

                        <asp:Label ID="WIDADL1Label" runat="server" Text='<%# Eval("WIDADL1") %>'></asp:Label><br />

                        <asp:Label ID="CityLabel" runat="server" Text='<%# Eval("WIDCITY") %>'></asp:Label>

                        &nbsp;

                        <asp:Label ID="StateLabel" runat="server" Text='<%# Eval("WIDST") %>'></asp:Label>

                        ,&nbsp;

                        <asp:Label ID="ZipLabel" runat="server" Text='<%# Eval("WIDZC") %>'></asp:Label><br />

                    </ItemTemplate>

                </asp:DataList>

                <br />

                <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:iwfdevDistributors %>"

                    SelectCommand="SELECT REGION.region, DISTFIL.WIDST, DISTFIL.WIDNAM, DISTFIL.WIDADL1, DISTFIL.WIDCITY, DISTFIL.WIDZC, &#13;&#10;                                    DISTFIL.WIDPHO, DISTFIL.WIDALT, DISTFIL.WIDFAX FROM REGION INNER JOIN DISTFIL ON REGION.rgID = DISTFIL.WIDST &#13;&#10;                                    WHERE (REGION.region = @region) ORDER BY WIDNAM">

                    <SelectParameters>

                        <asp:ControlParameter ControlID="regionLabel" Name="region" PropertyName="Text"

                            Type="String" />

                    </SelectParameters>

                </asp:SqlDataSource>

            </ItemTemplate>

        </asp:DataList>
 

        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:iwfdevDistributors %>"

            SelectCommand="SELECT REGION.region, REGION.rgID FROM REGION INNER JOIN DISTFIL ON REGION.rgID = DISTFIL.WIDST GROUP BY REGION.region, REGION.rgID ORDER BY REGION.region">

        </asp:SqlDataSource>

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Javascript in a user control not working 17 69
crm development 2 68
Execute Stored Procedure for a set of values 5 44
Turn on intranet settings 1 41
Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now