Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
I have a problem with responsive using datalist control.
I am using 1 column, that is display data 15*6 using datalist. I have to take RepeatColumns="6"
my html design have responsive. when I use datalist control for dynamic data, I loose my responsive.
my design like this,
1       2      3    d       s       s
4       5      6    s       e       h
7       8      9    d       d       t
10      11     12 etc..

Is there any alternative.
Please help me...
Thank you....
Posted

XML
<asp:DataList ID="DataList1" runat="server"  RepeatLayout="Flow">
                     <ItemTemplate>
                       <div class="col-sm-4 products">
                    <div class="news_img">
                        <asp:Image ID="Image1" runat="server" class="img-responsive center-block" ImageUrl='<%# bind("backgroundimage") %>'/>
                      </div>
                    <h2 class="heading1">
                        <asp:Label ID="lblName" runat="server" Text='<%# bind("Name") %>'></asp:Label></h2>
                    <p class="product_con">
                        <asp:Label ID="lblDescription" runat="server" Text='<%# bind("Description") %>'></asp:Label></p>
                    <div class="btn btn-primary center-block"><a href="#">+ Read More</a></div>
           </div>

                   </ItemTemplate>

               </asp:DataList>
 
Share this answer
 
Comments
Member 10406386 23-Mar-15 5:44am    
what are the definition of class col-sm-4, products, news_img, img-responsive, center-block?
XML
You can use ListView with bootstrap or some other responsive framework.

<asp:ListView ID="MyListView" runat="server" ...>
    ...
    <ItemTemplate>
        <div class="row">
            <div class="col-md-3"><%# Eval("Name") %></div>
            <div class="col-md-3"><%# Eval("Email") %></div>
            <div class="col-md-3"><%# Eval("Age") %></div>
            <div class="col-md-3"><%# Eval("Address") %></div>
        </div>
    </ItemTemplate>
</asp:ListView>
 
Share this answer
 
Comments
NehalSS 22-Apr-15 2:15am    
This will display a grid and not in datalist style. (column style)
The solution is incorrect.
Same problem
<asp:DataList ID="Image_Results" runat="server" RepeatDirection="Horizontal" >
<itemtemplate>


<img style="height:200px; width:200px;" src=" <%# Eval("Image_path") %> " />


 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900