Solved

Listview design with itemTemplate and Layout

Posted on 2010-11-17
5
592 Views
Last Modified: 2012-05-10
Id like the Listview look like this:
   control                          field                  Field           control
checkbox            SchoolID          SchoolName          Button


How will I design this?
0
Comment
Question by:zachvaldez
  • 2
  • 2
5 Comments
 
LVL 13

Assisted Solution

by:AngryBinary
AngryBinary earned 75 total points
ID: 34158915
I would design that as a GridView, since what you're looking at is basically a table of data with some context controls:

<asp:GridView id="GridView1" runat="server" autogeneratecolumns="false">
<Columns>
<asp:TemplateField><ItemTemplate><asp:CheckBox id="CheckBox1" runat="server" /></ItemTemplate></asp:TemplateField>
<asp:BoundField datafield="SchoolID" />
<asp:BoundField datafield="SchoolName" />
<asp:TemplateField><ItemTemplate><asp:Button id="Button1" runat="server" Text="Button" /></ItemTemplate></asp:TemplateField>
</Columns>
</asp:GridView>
0
 

Author Comment

by:zachvaldez
ID: 34159065
All my designs are in gridview. I d like this ot be in listview if possible.
0
 
LVL 7

Accepted Solution

by:
mr_nadger earned 175 total points
ID: 34173148
closing because two days isn't quick enough?

This is fairly simple to do, use CSS to create a columnar layout and apply it to the itemtemplate of the listview.

.left3col
{
	width: 33%;  
    text-align: left;
    font-size:medium ;
	position: absolute;
	background-color:white;
}
.mid3col
{
    Left:34%;
    width: 33%;  
    text-align: left;
    font-size:medium ;
	position: absolute;
	background-color:white;
}
.right3col
{
    Left:67%;
    width: 33%;  
    text-align: left;
    font-size:medium ;
	position: absolute;
	background-color:white;
}

Open in new window

0
 
LVL 7

Expert Comment

by:mr_nadger
ID: 34173161
granted the css only has three columns, but it's easily adapted to add a fourth, the only caveat is keeping the widths consistent
0
 

Author Comment

by:zachvaldez
ID: 34174805
thnaks! it can be done using listview and itmtemplate the ideas are appreciated. I'll keep the css code for future use.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

809 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