473,659 Members | 2,922 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with GridView layout

ASP.NET 2.0

I've got problems with the right column in my GridView. The GridView consist
of 2 columns, the problem column is the column on the right side.

The problem is that it looks like there is a huge space between the 2
columns, see the huge grey space between the 2 columns. I want the columns
to be very close to each other with only 10px open space between the
columns. Now it looks like there is a 160px margin between them

When I resize the browser window I see that the right column floats to the
right, I want it to float to the left so it align close to the left column
and then fills up rest of the GridView (column 1 is about 160px wide, the
problem column should take up rest of the horizontal space in the GridView)

Here is a screenshot which illustrate the problem:
http://home.online.no/~au-holme/pub/768/gridproblem.JPG

This is the markup of this GridView:
<asp:GridView ID="gridUsers"
runat="server"
AutoGenerateCol umns="false"
OnRowDataBound= "gridUsers_RowD ataBound" Width="100%" BorderStyle="No ne"
BorderWidth="0" RowStyle-BackColor="#999 999"
AlternatingRowS tyle-BackColor="#666 666" >
<Columns>
<asp:TemplateFi eld HeaderStyle-Width="160px"
FooterStyle-Width="160px" ControlStyle-BackColor="Beig e"
ControlStyle-Height="140px" ControlStyle-Width="160px" >
<HeaderTemplate >
Picture
</HeaderTemplate>
<ItemTemplate >
<div style="width:16 0px; background-color:Yellow;
height:140px; padding-bottom:10px; padding-top:10px; padding-left:10px;
padding-right:10px;">
<asp:ImageMap ID="MemberPhoto " runat="server"
OnClick="OnClic k" HotSpotMode="Po stBack" Width="140" Height="140">
<asp:RectangleH otSpot Top="0" Left="0" Right="140"
Bottom="140" />
</asp:ImageMap>
</div>
</ItemTemplate>
<AlternatingIte mTemplate>
<div style="width:16 0px; height:140px; padding-bottom:10px;
padding-top:10px; padding-left:10px; padding-right:10px;">
<asp:ImageMap ID="MemberPhoto " runat="server"
OnClick="OnClic k" HotSpotMode="Po stBack" Width="140" Height="140">
<asp:RectangleH otSpot Top="0" Left="0"
Right="140" Bottom="140" />
</asp:ImageMap>
</div>
</AlternatingItem Template>
<FooterTemplate ></FooterTemplate>
</asp:TemplateFie ld>
<asp:TemplateFi eld>
<HeaderTemplate >
Details
</HeaderTemplate>
<ItemTemplate >
<div style="backgrou nd-color:Purple;">
<asp:Label ID="Fullname" runat="server"
Text=""></asp:Label>
<asp:Label ID="Label1" runat="server"
Text="Test"></asp:Label>
</div>
</ItemTemplate>
<AlternatingIte mTemplate>
<div>
<asp:Label ID="Fullname" runat="server"
Text=""></asp:Label>
<asp:Label ID="Label2" runat="server"
Text="Test"></asp:Label>
</div>
</AlternatingItem Template>
</asp:TemplateFie ld>
</Columns>
</asp:GridView>
Any suggestions????
Mar 9 '07 #1
1 6722
well, somehow I've solved it... i had to set the width on the right
column... not an ideal solution but that is best I've could do... if anyone
of you have a better solution then please share it with me
"Jeff" <it************ @hotmail.com.NO SPAMwrote in message
news:%2******** *******@TK2MSFT NGP04.phx.gbl.. .
ASP.NET 2.0

I've got problems with the right column in my GridView. The GridView
consist of 2 columns, the problem column is the column on the right side.

The problem is that it looks like there is a huge space between the 2
columns, see the huge grey space between the 2 columns. I want the columns
to be very close to each other with only 10px open space between the
columns. Now it looks like there is a 160px margin between them

When I resize the browser window I see that the right column floats to the
right, I want it to float to the left so it align close to the left column
and then fills up rest of the GridView (column 1 is about 160px wide, the
problem column should take up rest of the horizontal space in the
GridView)

Here is a screenshot which illustrate the problem:
http://home.online.no/~au-holme/pub/768/gridproblem.JPG

This is the markup of this GridView:
<asp:GridView ID="gridUsers"
runat="server"
AutoGenerateCol umns="false"
OnRowDataBound= "gridUsers_RowD ataBound" Width="100%" BorderStyle="No ne"
BorderWidth="0" RowStyle-BackColor="#999 999"
AlternatingRowS tyle-BackColor="#666 666" >
<Columns>
<asp:TemplateFi eld HeaderStyle-Width="160px"
FooterStyle-Width="160px" ControlStyle-BackColor="Beig e"
ControlStyle-Height="140px" ControlStyle-Width="160px" >
<HeaderTemplate >
Picture
</HeaderTemplate>
<ItemTemplate >
<div style="width:16 0px; background-color:Yellow;
height:140px; padding-bottom:10px; padding-top:10px; padding-left:10px;
padding-right:10px;">
<asp:ImageMap ID="MemberPhoto " runat="server"
OnClick="OnClic k" HotSpotMode="Po stBack" Width="140" Height="140">
<asp:RectangleH otSpot Top="0" Left="0" Right="140"
Bottom="140" />
</asp:ImageMap>
</div>
</ItemTemplate>
<AlternatingIte mTemplate>
<div style="width:16 0px; height:140px; padding-bottom:10px;
padding-top:10px; padding-left:10px; padding-right:10px;">
<asp:ImageMap ID="MemberPhoto " runat="server"
OnClick="OnClic k" HotSpotMode="Po stBack" Width="140" Height="140">
<asp:RectangleH otSpot Top="0" Left="0"
Right="140" Bottom="140" />
</asp:ImageMap>
</div>
</AlternatingItem Template>
<FooterTemplate ></FooterTemplate>
</asp:TemplateFie ld>
<asp:TemplateFi eld>
<HeaderTemplate >
Details
</HeaderTemplate>
<ItemTemplate >
<div style="backgrou nd-color:Purple;">
<asp:Label ID="Fullname" runat="server"
Text=""></asp:Label>
<asp:Label ID="Label1" runat="server"
Text="Test"></asp:Label>
</div>
</ItemTemplate>
<AlternatingIte mTemplate>
<div>
<asp:Label ID="Fullname" runat="server"
Text=""></asp:Label>
<asp:Label ID="Label2" runat="server"
Text="Test"></asp:Label>
</div>
</AlternatingItem Template>
</asp:TemplateFie ld>
</Columns>
</asp:GridView>
Any suggestions????

Mar 9 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1659
by: knoak | last post by:
hi there, A few days ago i posted a question how i could divide a query's result over 2 collumns. I got the following code thanks to Pedro: > echo '<table class="search_result" summary="search result">'; > $column = 0; > while ($row = mysql_fetch_array($result)) {
2
2131
by: guanfenglin | last post by:
Hello, I have a grid view which display and updates the data, however it doesn't work well, I always either get invalid name/number or not all varaibles bound, I am very frustrated at the moment. Thank you very much!! Here is the gridview code:
2
1275
by: Marc Grutte | last post by:
Hi How can you configure the layout of the gridview? thanks M
0
1073
by: Nathan Laff | last post by:
I have a user control which has a custom label. when the labels width changes, it adjusts it's height to fit it all. Then when I adjust the width of the user control if the height of the label changes, i also have to change the height of the user control So, on that note on the Layout event of the user control I do this... private void UserControl_Layout(object sender, LayoutEventArgs e) { this.Height = labelDescription.Bottom +...
2
1182
by: desperateboy | last post by:
hi I am trying to create a two-column layout using XHTML and CSS. I'm having a problem having the text in the second column start at the top of the column. How do I make sure that the text will go to the top of the second column? I don't get any reply from web site design company 's forum .I am registered with site.If u got my problem,Give relevant solution. Thanks in advance.
10
3324
by: ellie2905 | last post by:
Hello, I am new to this forum and I am glad I found it because it seems that it will help me with my problem.I have creates a site using jsf components like grid panels and buttons.In the mozilla firefox browser the components are shown just as they are supposed to, but in internet explorer my button stretches to the right until the end of the page and two buttons that I have included on a grid panel, instead of being the one below the other, in...
2
1061
by: RobertTheProgrammer | last post by:
Hi all, I'm really stuck here. I've got a GridView on my page and I want to use the update features to-- well, update. Here is my block of code in the SqlDataSource section: <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringTraining %>" ProviderName="<%$ ConnectionStrings:ConnectionStringTraining.ProviderName %>" SelectCommand="SELECT...
5
1895
by: creative1 | last post by:
hi everyone, I am struck in layout of my site. Im using 1024 fixed width layout. I have a site layout designed in psd files. Bisically I have to stick with that design tightly and I am asked not to chnage even a pixel. As I am not too good so I though why not ask you. I am using dreameweaver for my ease in design. The problem is "expanding box problem and cruel appearance in IE and site looks better in FFox". I am not usinf any image bigger...
4
2984
by: Ananthu | last post by:
I have created a templatefield at runtime for checkboxcolumn in gridview using Itemplate Interface and InstanceIn methods. I have given the id for checkbox also. I get the checkbox column in gridview successfully. Now i want to check all the checkbox in gridview. But when i find checkbox controls in gridview with respect to the id i have given, it returns me nothing.
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8747
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.