style property
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngbeta' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

dave 123aspx.com (VIP)
hi all,
I'm looking to add style attributes to an <asp:boundcolumn /> tag.

so something like:
<asp:BoundColumn style="border-right:1px solid #336699;" HeaderText="Author" DataField="aulname"/>

will render
<td style="border-right:1px solid #336699;">Frost</td>

but i get the error:
Type 'System.Web.UI.WebControls.BoundColumn' does not have a property named 'style'

Any suggestions?

Thanks,
dave
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.123aspx.com
The Largest ASP.NET Directory!
Find the latest ASP.NET resources --
Subscribe to our newsletter!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply to this message...
 
    
Alex Lowe
Dave,

I think you want to use <asp:BoundColumn ItemStyle="border-right:1px solid #336699;" HeaderText="Author" DataField="aulname"/>. Didn't test it though =)

hth,
Alex
http://www.asp-grandrapids.net
Click here to reveal e-mail address

----- Original Message -----
From: "dave 123aspx.com" <Click here to reveal e-mail address>
To: "aspngbeta" <Click here to reveal e-mail address>
Sent: Monday, May 07, 2001 3:53 PM
Subject: [aspngbeta] style property

[Original message clipped]

Reply to this message...
 
    
dave 123aspx.com (VIP)
Thanks!
However, I've already tried that and got the following error:

Parser Error Message: 'ItemStyle' property is readonly and cannot be set

there has to be someway of doing this, i mean, what if I wanted to add some type of Javascript to the <TD> tag? Or an Expando property?
I know you can di with through code using the Attributes property and generic HTML controls, but here I'm trying to use <asp:boundcolumn />.

thanks,
dave
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.123aspx.com
The Largest ASP.NET Directory!
Find the latest ASP.NET resources --
Subscribe to our newsletter!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------- Original Message ----------------------------------
From: "Alex Lowe" <Click here to reveal e-mail address>
Reply-To: "aspngbeta" <Click here to reveal e-mail address>
Date: Mon, 7 May 2001 16:01:50 -0400

[Original message clipped]

Reply to this message...
 
    
Das (VIP)
Dave,

try by giving

Itemstyle-bordercolor="#000000"
Itemstyle-borderwidth=1

thanks,
das.

----- Original Message -----
From: "dave 123aspx.com" <Click here to reveal e-mail address>
To: "aspngbeta" <Click here to reveal e-mail address>
Sent: Monday, May 07, 2001 3:31 PM
Subject: [aspngbeta] Re: style property

[Original message clipped]

though =)
[Original message clipped]

_________________________________________________________

Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com

Reply to this message...
 
    
Doug Seven

You can also create a stylesheet and use:
<style rel=Styleshhet>
.myStyle { border-right:1px solid #336699; }
</style>
.....
<asp:BoundColumn runat="server" CssClass="myStyle" />
___________________________________________
Doug Seven
codejunkies.net

Are you a DotNetJunkie?
http://www.AspNextGen.com
http://www.DotNetJunkies.com

Still not enough? Buy the book:
Programming Datadriven Web Applications with ASP.NET
by Doug Seven and Don Wolthuis
http://www.amazon.com/exec/obidos/ASIN/0672321068/dotnetjunkies-20/105-60122
87-6260738

"Honestly, this really isn't a brains kind of operation"
- Benicio del Toro, The Way of the Gun

[Original message clipped]

Reply to this message...
 
    
dave 123aspx.com (VIP)
Thanks!

But again, I was only using this particular case as an example. How can you
add expando properties, or custom javascript code, to <asp:_controls_ /> ?
Or can't you? Say for instance I wanted to add the Title="this is my short
little description that will pop up" attribute to <asp:boundcolumn /> ?

Any ideas? Or am i just rambling....

Thanks,
dave
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.123aspx.com
The Largest ASP.NET Directory!
Find the latest ASP.NET resources --
Subscribe to our newsletter!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: "Doug Seven" <Click here to reveal e-mail address>
To: "aspngbeta" <Click here to reveal e-mail address>
Sent: Monday, May 07, 2001 4:32 PM
Subject: [aspngbeta] Re: style property

[Original message clipped]

Reply to this message...
 
    
Remas Wojciechowski
Dave,

Never tried that so far, but I reckon it should be possible to create a
control that inherits from (e.g.) boundcolumn and adds some more
attributes. The downfall is, I guess, it won't interoperate with other
web controls in a proper manner. Just like the boundcolumn is
automatically assumed to be a column definition of a DataGrid. If you
created something like <myextension:boundcolumn> I don't think the
compiler will guess you intensions.

Does it make sense?

Remas
http://www.aspalliance.com/remas/

--- "dave 123aspx.com" <Click here to reveal e-mail address> wrote:
[Original message clipped]

=====
Remas Wojciechowski
http://www.aspalliance.com/remas/

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Reply to this message...
 
 
System.Web.UI.WebControls.BoundColumn
System.Web.UI.WebControls.DataGrid
System.Windows.Forms.DataGrid




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com