Datalist显示布局问题 [英] Datalist display layout problem
本文介绍了Datalist显示布局问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello All,
我对datalist有点问题。
我有一个显示来自sql server的数据的数据列表。
datalist显示从上到下的记录。
但是我想从左到右显示数据列表显示记录(仅在一行中)。(例1,2,3,4 ,5,6,7,8,9 ......................... n nubmer)
i我正在使用此代码..
< asp:DataList ID = DataList1 runat = server CellPadding = 4 RepeatLayout = 流程 DataSourceID = SqlDataSource1
ForeColor = #333333 宽度 = 300px RepeatColumns = 2 RepeatDirection = 水平 >
< AlternatingItemStyle BackColor = < span class =code-keyword>白色 ForeColor = #284775 / >
< FooterStyle Font-Bold = True ForeColor < span class =code-keyword> = 白色 BackColor = #5D7B9D / >
< HeaderStyle Font-Bold = True ForeColor = 白色 BackColor = #5D7B9D / >
< ItemStyle ForeColor = # 333333 BackColor = #F7F6F3 / >
< ItemTemplate >
< a < span class =code-attribute> class =' IFRAME'跨度> < span class =code-attribute> href = business-plans.aspx?nm ='<% #Eval( 名称)%> ' >
< div class = card style = min-height:50px; >
< div class = fl >
< asp:图像 ID = Image2 runat < span class =code-keyword> = server 样式 = border:1px solid#C6C6C6;向左飘浮;
身高:50px; border-radius:3px; width:50px; ImageUrl =' <%# AdminGetImage.aspx?id = + Eval( id)%> ' / >
< / div >
< div class = fl style = margin-left:7px;宽度:215px; >
< div >
< asp:标签 ID = Sent_FromLabel 字体 - 大小 = 10px 样式 = text-transform:capitalize;
font-weight:bold; 字体名称 = Verdana ForeColor = #014265 runat = server 文字 =' <% #Eval( 名称)%> ' / >
< / div >
< div >
< div >
< asp:标签 ID = label3 runat = 服务器 字体名称 = Verdana ForeColor = # 014265 字体大小 = 10px
文本 =' <% #Eval( 地址) %> ' / >
< / div >
< div 样式 = margin-top:2px; >
< asp:标签 ID = Label1 字体大小 = 10px 字体 - 姓名 = Verdana ForeColor = #014265
< span class =code-attribute> runat = server 文字 =' <% #Eval( 移动)%> ' / > ,
< asp:Label ID = Label4 字体大小 = 10px 字体名称 = Verdana < span class =code-attribute> ForeColor = #014265
< span class =code-attribute> runat = server 文本 =' <% #Eval( Office)%> ' / >
< / div >
< div >
< asp:标签 ID = Label2 runat = server 文字 =' < span class =code-keyword> <% #Eval( claim_status)%> ' class = 声明 > < / asp:Label >
< / div >
< / div >
< / div >
< div class = clr >
< / div >
< / div < span class =code-keyword>>
< < span class =code-leadattribute> / a >
< / ItemTemplate >
< SelectedItemStyle BackColor = #E2DED6 Font-Bold = True ForeColor = #333333 / >
< / asp:DataList >
< asp:SqlDataSource ID = SqlDataSource1 runat = server ConnectionString = <% $ ConnectionStrings:MyArea %>
SelectCommand = src_tbl SelectCommandType = StoredProcedure >
< / asp :SqlDataSource >
解决方案
ConnectionStrings:MyArea %>
< span class =code-attribute> SelectCommand = src_tbl SelectCommandType= StoredProcedure >
< / asp:SqlDataSource >
Hello All,
I have a little problem with datalist.
I have a datalist that display data from sql server.
datalist display records from top to down direction.
but i want datalist display records from left to right(only in one row).(Example 1,2,3,4,5,6,7,8,9.........................n nubmer)
i am using this code..
<asp:DataList ID="DataList1" runat="server" CellPadding="4" RepeatLayout="Flow" DataSourceID="SqlDataSource1"
ForeColor="#333333" Width="300px" RepeatColumns="2" RepeatDirection="Horizontal">
<AlternatingItemStyle BackColor="White" ForeColor="#284775" />
<FooterStyle Font-Bold="True" ForeColor="White" BackColor="#5D7B9D" />
<HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#5D7B9D" />
<ItemStyle ForeColor="#333333" BackColor="#F7F6F3" />
<ItemTemplate>
<a class='iframe' href="business-plans.aspx?nm='<%# Eval("Name") %>'">
<div class="card" style="min-height: 50px;">
<div class="fl">
<asp:Image ID="Image2" runat="server" Style="border: 1px solid #C6C6C6; float: left;
height: 50px; border-radius: 3px; width: 50px;" ImageUrl='<%# "AdminGetImage.aspx?id=" + Eval("id")%>' />
</div>
<div class="fl" style="margin-left: 7px; width: 215px;">
<div>
<asp:Label ID="Sent_FromLabel" Font-Size="10px" Style="text-transform: capitalize;
font-weight: bold;" Font-Names="Verdana" ForeColor="#014265" runat="server" Text='<%# Eval("Name") %>' />
</div>
<div>
<div>
<asp:Label ID="label3" runat="server" Font-Names="Verdana" ForeColor="#014265" Font-Size="10px"
Text='<%# Eval("Address") %>' />
</div>
<div style="margin-top: 2px;">
<asp:Label ID="Label1" Font-Size="10px" Font-Names="Verdana" ForeColor="#014265"
runat="server" Text='<%# Eval("Mobile") %>' />,
<asp:Label ID="Label4" Font-Size="10px" Font-Names="Verdana" ForeColor="#014265"
runat="server" Text='<%# Eval("Office") %>' />
</div>
<div>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("claim_status") %>' class="claim"></asp:Label>
</div>
</div>
</div>
<div class="clr">
</div>
</div>
</a>
</ItemTemplate>
<SelectedItemStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
</asp:DataList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MyArea %>"
SelectCommand="src_tbl" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>
解决方案
ConnectionStrings:MyArea %>" SelectCommand="src_tbl" SelectCommandType="StoredProcedure"> </asp:SqlDataSource>
这篇关于Datalist显示布局问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文