473,398 Members | 2,368 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,398 software developers and data experts.

Datagrid generating duplicate border attribute

Why is the Datagrid creating a multiple border attribute?

With this code:

<asp:DataGrid AllowPaging="true"
AllowCustomPaging="false"
PageSize="4"
PagerStyle-Visible="false"
visible="false"
AllowSorting="True"
AutoGenerateColumns="false"
CellPadding="3"
CellSpacing="0"
ID="DataGrid2"
runat="server"
ShowFooter="false"
ShowHeader="true"
OnSortCommand="SortDataGrid"
border="1"
BorderColor="#999999"
style="margin:auto;">

I am getting this:

<table cellspacing="0" cellpadding="3" rules="all" border="1"
bordercolor="#999999" border="1" id="DataGrid1" style="margin: auto; ">
Why am I getting 2 Border attributes?

This is causing some of my code to work funny.

Thanks,

Tom
Nov 19 '05 #1
2 1271
Hi Tshad,

The "border" attribute you used in your tag is actually an HTML attribute,
the server-side "BorderWidth" attribute is assuming a default size of 1 since
it is not present and translates into the same border attribute that you
used. To solve the problem, remove the incorrect "border" attribute or
replace it with "BorderWidth"

Cheers,
Steve Goodyear
Vancouver, Canada
Nov 19 '05 #2
"Steve Goodyear" <St***********@discussions.microsoft.com> wrote in message
news:DE**********************************@microsof t.com...
Hi Tshad,

The "border" attribute you used in your tag is actually an HTML attribute,
the server-side "BorderWidth" attribute is assuming a default size of 1
since
it is not present and translates into the same border attribute that you
used. To solve the problem, remove the incorrect "border" attribute or
replace it with "BorderWidth"


You're right.

But when I changed it to:

<asp:DataGrid AllowPaging="true"
AllowCustomPaging="false"
PageSize="4"
PagerStyle-Visible="false"
Visible=false
AllowSorting="True"
AutoGenerateColumns="false"
CellPadding="3"
CellSpacing="0"
ID="DataGrid1"
runat="server"
ShowFooter="false"
ShowHeader="true"
OnSortCommand="SortDataGrid"
BorderWidth="0"
style="margin: auto; ">

I took out the border, bordercolor and added in the borderwidth.

I still have the rules="all", which gets rid of the outside border but
leaves the inside border (rules) on.

<table cellspacing="0" cellpadding="3" rules="all" border="0" id="DataGrid1"
style="margin: auto; ">

What is causing that?

Thanks,

Tom
Nov 19 '05 #3

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

Similar topics

2
by: Bernt Fischer | last post by:
Hello I want to render a datagrid with transparent borders (cellspacing = 1) so the underlying background shines through. Unfortunately, ASPNET renders the <table> tag with a 'rules="all"...
1
by: Vaclav Jedlicka | last post by:
Hi I need a datagrid on a page, but it is rendered with the style "border-collapse:collapse;". I do not need this style. It interferes with the settings in my CSS file. I tried to supress it...
2
by: Marty McDonald | last post by:
When setting certain datagrid properties with the IDE (as in the property window), they don't seem to take effect. For instance, Font Name. So I have to set these via code-behind at the cell...
0
by: francois | last post by:
I am using a datagrid, I assign in my <asp:Datagrid> tag an attribute linking to my css file. This works well and give me my desired behvior except for one thing. I will show my code and then...
3
by: Bill Endow | last post by:
I've noticed that the WebControl.Table class always outputs the attribute "border="0"", and I cannot stop it from doing so, no matter what I try. I end up with generated HTML that looks like: ...
5
by: David Freeman | last post by:
Hi There! I'm using ASP.NET 1.1 and VB. Below is my DataGrid declaration... <asp:DataGrid id="myDataGrid" runat="server" AutoGenerateColumns="false"
5
by: tshad | last post by:
I have been trying to figure out what the Datagrid is doing to create its formatting. I found that some of my Datagrids have a 3D type of border and sometime it has a straight line. I finally...
3
by: Alex Maghen | last post by:
I'd like there to be a border around each row of my data-grid but NOT between the columns. I've tried setting BorderColor="Black" BorderStyle="Solid" BorderWidth="1px"...
3
by: kingflux | last post by:
Hello, and thank you in advance for any help you can provide. Each line in our datagrid control contains a product number, description, and a textbox for the user to enter a quantity-to-order. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.