473,498 Members | 1,992 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CSS and datagrid?

Hi folks,
I'm using VS 2003 with Framework 1.1
I'm writing an intranet application that makes use of Datagrids

I will be creating the columns declaratively (and not using autogenerate)

I wish to tie various CSS styles with various columns particularly for
the purposes of width/height/padding and borders

I know that CSS doesn't deal with the level of abstraction of a datagrid
bound column and works mainly with XHTML (or XML) elements, which is what the
bound column becomes when sent via HTTP to the browser.

so am I right in thinking that I set the CSS rule to be for the <TD> element
but with a different class and/or ID class for each differently formatted
column?
if so, how do I say that this column is this CSS class...do I just give each
column and ID or class and that's that?

or is all that wrong and you know of a better way of solving this problem
Any help would be greatly appreciated!
Regards and Thanks in advance,
CharlesA

Feb 3 '06 #1
3 1321
Charles you could have
..DataGrid {
background-color: white;
border-color: #999999;
}
And then in your datagrid use CssClass="DataGrid"or see philips demo here
athttp://www.societopia.net/samples/DataGrid_cssClass.aspxHope that
helpsPatrick"CharlesA" <Ch******@discussions.microsoft.com> wrote in message
news:D5**********************************@microsof t.com...
Hi folks,
I'm using VS 2003 with Framework 1.1
I'm writing an intranet application that makes use of Datagrids

I will be creating the columns declaratively (and not using autogenerate)

I wish to tie various CSS styles with various columns particularly for
the purposes of width/height/padding and borders

I know that CSS doesn't deal with the level of abstraction of a datagrid
bound column and works mainly with XHTML (or XML) elements, which is what
the
bound column becomes when sent via HTTP to the browser.

so am I right in thinking that I set the CSS rule to be for the <TD>
element
but with a different class and/or ID class for each differently formatted
column?
if so, how do I say that this column is this CSS class...do I just give
each
column and ID or class and that's that?

or is all that wrong and you know of a better way of solving this problem
Any help would be greatly appreciated!
Regards and Thanks in advance,
CharlesA

Feb 3 '06 #2
Thanks for that Patrick
I can't however access that link you showed ! something is broken there.
Regards,
CharlesA
Feb 3 '06 #3
Hi Charles,

The datagrid has a syntax for specifying the styles for each area, e.g.
header, footer, item, like this:
<HeaderStyle CssClass ="DataGrid1HeaderStyle"></HeaderStyle>
<EditItemStyle CssClass="DataGrid1EditItemStyle"></EditItemStyle>
<AlternatingItemStyle CssClass ="DataGrid1Alternate"></AlternatingItemStyle>

Then each column within the ItemTemplate allows you syntax to specifying a
cssClass for each column if you wish. The link that Patrick posted for the
demo is: http://www.societopia.net/samples/Da..._cssClass.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"CharlesA" wrote:
Thanks for that Patrick
I can't however access that link you showed ! something is broken there.
Regards,
CharlesA

Feb 3 '06 #4

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

Similar topics

8
7882
by: Ashish Shridharan | last post by:
Hi All I have been trying to add a control to the header cell of a datagrid on my ASP.NET page. These controls are defined in the HTML as ASP.NET web controls. They are being added into the...
3
4234
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
5
9164
by: BBFrost | last post by:
Win2000 ..Net 1.1 SP1 c# using Visual Studio Ok, I'm currently in a "knock down - drag out" tussle with the .Net 1.1 datagrid. I've come to realize that a 'block' of rows highlighted within...
2
4315
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
1
4275
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls...
3
2769
by: CVerma | last post by:
Hi, I have an embedded datagrid within a datalist. I am not able to perfrom paging in the datagrid. Any ideas? Here is my code: Here is my Simplegrid.cs file: using System; using...
2
6371
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
7
5653
by: Dave | last post by:
Are there any add-on products or samples available that can do the following in an vb.net datagrid I want to compare 2 rows in a datagrid - one row from one database and another row for another...
9
2706
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
2
6557
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click...
0
7125
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
7165
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
7203
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...
1
6885
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
7379
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
5462
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,...
1
4908
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...
0
1417
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.