3 Replies - 661 Views - Last Post: 22 January 2018 - 07:17 AM Rate Topic: -----

#1 ikhlas06   User is offline

  • D.I.C Regular

Reputation: 1
  • View blog
  • Posts: 327
  • Joined: 20-May 16

how to create a responsize shopping item grid?

Posted 21 January 2018 - 08:44 PM

I am using vb asp.net and bootstrap

how to create a responsize shopping item grid?

trying to build test shoping site. I have a gridview where there will be items in each col..

issue is that image can be in many different size. for ex image can be 100X200 or 100x400 or 600x300 etc...

I am also using bootstrap so "img-responsive" class I can use for images in cols

how can i set gridview col size 300x450? and img will be responsive


any idea how can i solve this issue or if there is a better way to do this?

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" 
            DataKeyField="ID">
                <Columns> 
                    <asp:TemplateField>
                      <ItemTemplate>
                          <img src='<%# Eval("Picture_Path") %>' alt='' class="img-responsive" /> <br/>
                          <asp:Label ID="Label1" runat="server" Text='<%# Eval("Name") %>'></asp:Label> <br/>
                          <asp:Label ID="Label3" runat="server" Text='<%# Eval("Price") %>'></asp:Label>
                      </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <PagerStyle CssClass="myPagerStyle" />
            </asp:GridView>


well now that i think about it. wouldnt it make more sense to make cols class="img-responsive"?

Is This A Good Question/Topic? 0
  • +

Replies To: how to create a responsize shopping item grid?

#2 andrewsw   User is online

  • So Smart! S-M-R-T!
  • member icon

Reputation: 6578
  • View blog
  • Posts: 26,723
  • Joined: 12-December 12

Re: how to create a responsize shopping item grid?

Posted 22 January 2018 - 12:32 AM

Question moved to ASP.NET forum.

I will add a comment that a variety in widths between 100 and 600 px (etc.) is too wide IMO to expect consistent, responsive, behaviour across devices, particularly in a grid. I would want to concentrate on restricting the maximum, even to obtain alternative images and perhaps using another control to display a larger version of an image.
Was This Post Helpful? 0
  • +
  • -

#3 andrewsw   User is online

  • So Smart! S-M-R-T!
  • member icon

Reputation: 6578
  • View blog
  • Posts: 26,723
  • Joined: 12-December 12

Re: how to create a responsize shopping item grid?

Posted 22 January 2018 - 12:39 AM

Quote

how can i set gridview col size 300x450? and img will be responsive

Are you looking to stretch and shrink the images to this size? (How would such specific dimensions be responsive?)
Was This Post Helpful? 0
  • +
  • -

#4 ikhlas06   User is offline

  • D.I.C Regular

Reputation: 1
  • View blog
  • Posts: 327
  • Joined: 20-May 16

Re: how to create a responsize shopping item grid?

Posted 22 January 2018 - 07:17 AM

i want to shrink the image but while keep the constrain proportions


i saw this and i wanted to do some thing like this:
http://ibalenciaga.com/

This post has been edited by ikhlas06: 22 January 2018 - 07:41 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1