views:

96

answers:

2

I am wondering about the most elegant solution of having a grid with each cell having its own record and specify say 3 records across 5 down for example. It is having a "tile" effect of records

+1  A: 

You could look at this more of a layout (CSS) question than an ASP.NET MVC question.

Put 15 divs inside of a main div, and set them all to float: left;. Size the main div to be big enough to contain all the 15 tile divs, and make all the tile divs the same width (1/3 the width of the parent div if there's no margin or padding).

mgroves
Brute force is sometimes an option :). but a generic call on the page with the parameters being set in the controller allow for the greatest flexibity-> ie screen size/platform (mobile?) . I did something similar that put some of the logic in the page. I didnt like very much.
Joe
I'm not sure what you mean--your pagination should definitely be in the controller for sure. I'm only talking about showing a tiled grid. As far as mobile platforms, you can use an alternate style sheet (http://www.bushidodesigns.net/blog/mobile-device-detection-css-without-user-agent/)
mgroves
Joe
Okay I see what you mean now. Yeah you'd basically be specifying the grid size in the CSS and not the program. I suppose you've considered tables already, but you'd need to build some logic (into a helper class or extension method) to know when to go to the next row, and yeah that doesn't seem very elegant...
mgroves
A: 

I found something that is close to what I need and helpful

http://weblogs.asp.net/jeff/archive/2010/01/17/variations-on-a-simple-repeater-in-asp-net-mvc.aspx

Joe