473,387 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Gridview Checkbox Alignment Problem

I am having a strange problem - my GridView is displaying bits (from
SQL Server) as checkboxes (which is fine) but it shows each alternating
one centrally aligned.

Heading1 Heading2
Text [X] Checkbox
Text2 [X] Checkbox
Text3 [X] Checkbox
Text4 [X] Checkbox

My GridView is very generic and I use it to show data from any table.

I think it is controlled by CSS but which item / setting? Can anyone
help??

Here is my gridview defintion (I set the Select and Delete command at
runtime):

<asp:GridView ID="GridView1" runat="server"
DataSourceID="SqlDataSource1" AllowPaging="True"
OnSelectedIndexChanged="GridView1_SelectedIndexCha nged"
CssClass="GridStyle"
AllowSorting="True" OnRowDeleting="GridView1_RowDeleting"
Width="100%">
<RowStyle CssClass="RowStyle" HorizontalAlign="Left" />
<AlternatingRowStyle CssClass="AlternatingRowStyle"
HorizontalAlign="Left" />
<PagerSettings FirstPageImageUrl="../systemimages/First.png"
FirstPageText="" LastPageImageUrl="~/systemimages/Last.png"
LastPageText="" Mode="NextPreviousFirstLast"
NextPageImageUrl="~/systemimages/Next.png"
NextPageText=""
PreviousPageImageUrl="../systemimages/Prev.png" PreviousPageText="" />
<PagerStyle CssClass="CommandRowStyle" />
</asp:GridView>

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [Table]" DeleteCommand="DELETE
FROM [Table] WHERE SOmeId=@original_SomeId"
OnDeleted="SqlDataSource1_Deleted"></asp:SqlDataSource>

Jan 24 '07 #1
2 5120
Check AlternatingRowStyle.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"JonBosker" <Jo********@Yahoo.comwrote in message
news:11**********************@a34g2000cwb.googlegr oups.com...
I am having a strange problem - my GridView is displaying bits (from
SQL Server) as checkboxes (which is fine) but it shows each alternating
one centrally aligned.

Heading1 Heading2
Text [X] Checkbox
Text2 [X] Checkbox
Text3 [X] Checkbox
Text4 [X] Checkbox

My GridView is very generic and I use it to show data from any table.

I think it is controlled by CSS but which item / setting? Can anyone
help??

Here is my gridview defintion (I set the Select and Delete command at
runtime):

<asp:GridView ID="GridView1" runat="server"
DataSourceID="SqlDataSource1" AllowPaging="True"
OnSelectedIndexChanged="GridView1_SelectedIndexCha nged"
CssClass="GridStyle"
AllowSorting="True" OnRowDeleting="GridView1_RowDeleting"
Width="100%">
<RowStyle CssClass="RowStyle" HorizontalAlign="Left" />
<AlternatingRowStyle CssClass="AlternatingRowStyle"
HorizontalAlign="Left" />
<PagerSettings FirstPageImageUrl="../systemimages/First.png"
FirstPageText="" LastPageImageUrl="~/systemimages/Last.png"
LastPageText="" Mode="NextPreviousFirstLast"
NextPageImageUrl="~/systemimages/Next.png"
NextPageText=""
PreviousPageImageUrl="../systemimages/Prev.png" PreviousPageText="" />
<PagerStyle CssClass="CommandRowStyle" />
</asp:GridView>

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [Table]" DeleteCommand="DELETE
FROM [Table] WHERE SOmeId=@original_SomeId"
OnDeleted="SqlDataSource1_Deleted"></asp:SqlDataSource>

Jan 24 '07 #2
On Jan 24, 6:31 pm, "Eliyahu Goldin"
<REMOVEALLCAPITALSeEgGoldD...@mMvVpPsS.orgwrote:
Check AlternatingRowStyle.
Turns out it was not AlternatingRowStyle but RowStyle instead - and
more specifically I had an input sub-type (is that the word?) as shown
below:
..RowStyle
{
color:Navy;
font-variant:normal;
text-align:left;
}

..RowStyle input
{
width:90%;
}

I think that because it is set to 90% the control (checkbox) tries to
fill 90% of the box but as it cannot stretch ends up putting it in the
middle! Pretty bizarre! Thanks.

Feb 1 '07 #3

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

Similar topics

2
by: Andy Flash | last post by:
Hi. I'd like a little help working out what is going on with what should be a simple alignment problem. I have an outer table with a <td> which has an inner table. The <td> specified as...
2
by: derek.google | last post by:
I have an application that's crashing because of an alignment problem, and this is the smallest program that demonstrates what's happening: int main() { struct Message { unsigned short size;...
1
by: sgraber | last post by:
I have encountered a class data alignment issue in Microsoft Visual Studio .Net 2003 (C++, 7.1). The issue only appears in certain configurations. My class is a simple class with no inheritance....
2
by: Kamen | last post by:
Hello there, I try to define the properties font-size and font-bold of the pager of a gridview using the pagerstyle, but the settings are not appleyd at run time. What could be the reason for...
5
by: jmcpa | last post by:
I have put together a web page for a group and I am having an alignment problem. The page is at: I have a top banner divided into two parts - a top piece and a small clice at the bottom for...
4
by: aamirghanchi | last post by:
Hi, I am hoping if there is a kludge in IE6 to make the textbox align with the top label. It aligns perfectly fine in Opera and in Netscape/Firefox to some extent. Thanks. <style>...
1
by: shalini jain | last post by:
Hi, I am being faced with a strange problem... I wrote a code for displaying pages in HTML and hence was using HTML parser. Now i am using the same code but now parsing using XHTML that is i want...
1
Frinavale
by: Frinavale | last post by:
I'm working on an ASP.NET application using VB.NET for server side code. I have a GridView listing a bunch of stuff. Above the GridView I have a checkbox named "ChkBx_SelectAll". If this...
1
by: janetb | last post by:
I have a gridview with an update capabilities - a textbox column (roomName), a dropdownlist(orgID), a dropdownlist(roomTypeID),a checkbox column (dialOut), a checkbox column (dialIn). When I try to...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...

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.