473,785 Members | 2,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

skin file and gridview columns

Hi,

I'd like to apply a css class on all cells in all gridviews in my app. To
achieve that, I have to set hte item-style cssclass property of each
columns.

If I add this to my skin file :

<asp:GridView
runat="server"
>
<FooterStyle CssClass="GridV iewFooterStyle" />
<PagerStyle CssClass="GridV iewPagerStyle" />
<PagerSetting s PageButtonCount ="100" />
<SelectedRowSty le CssClass="GridV iewSelectedRowS tyle" />
<HeaderStyle CssClass="GridV iewHeaderStyle" />
<AlternatingRow Style CssClass="GridV iewAlternatingR owStyle" />
<Columns>
<asp:BoundFie ld ItemStyle-CssClass="ItemS tyle" />
</Columns>
</asp:GridView>

All gridview in my apps have only one column (empty) with the style
applied... It seems that when <Columnsis defined, it overrides all colums
definition in all pages...

Finally, the only way I found is to add the property to all columns in all
gridview in all pages which requires a lot of extra work....

Is there any way to reach my goal ?

Thanks,
Steve
Jun 21 '07 #1
3 17299
Steve B. wrote:
Hi,

I'd like to apply a css class on all cells in all gridviews in my
app. To achieve that, I have to set hte item-style cssclass property
of each columns.

If I add this to my skin file :

<asp:GridView
runat="server"
>>
<FooterStyle CssClass="GridV iewFooterStyle" />
<PagerStyle CssClass="GridV iewPagerStyle" />
<PagerSetting s PageButtonCount ="100" />
<SelectedRowSty le CssClass="GridV iewSelectedRowS tyle" />
<HeaderStyle CssClass="GridV iewHeaderStyle" />
<AlternatingRow Style CssClass="GridV iewAlternatingR owStyle" />
<Columns>
<asp:BoundFie ld ItemStyle-CssClass="ItemS tyle" />
</Columns>
</asp:GridView>

All gridview in my apps have only one column (empty) with the style
applied... It seems that when <Columnsis defined, it overrides all
colums definition in all pages...

Finally, the only way I found is to add the property to all columns
in all gridview in all pages which requires a lot of extra work....

Is there any way to reach my goal ?

Thanks,
Steve
Use RowStyle on the GridView, and remove the <Columstag.

By adding the <Columnstag, you are telling to all gridviews in your
applications to use this column defined in the skin. Obviously, that's
not what you want.

--

Riki
Jun 21 '07 #2
I don't want to target the row, but the cells.
I actually want to define this style :

ItemTemplate { border-top : solid black 2px;border-bottom : solid black
px }

If I apply this style to the row, it won't apply. I have to apply on the
cell (in fact, on the TD tag, not the TR).

Steve

"Riki" <ri**@dontnagme .comwrote in message
news:eq******** ******@TK2MSFTN GP06.phx.gbl...
Steve B. wrote:
>Hi,

I'd like to apply a css class on all cells in all gridviews in my
app. To achieve that, I have to set hte item-style cssclass property
of each columns.

If I add this to my skin file :

<asp:GridVie w
runat="serve r"
>>>
<FooterStyle CssClass="GridV iewFooterStyle" />
<PagerStyle CssClass="GridV iewPagerStyle" />
<PagerSettin gs PageButtonCount ="100" />
<SelectedRowSt yle CssClass="GridV iewSelectedRowS tyle" />
<HeaderStyle CssClass="GridV iewHeaderStyle" />
<AlternatingRo wStyle CssClass="GridV iewAlternatingR owStyle" />
<Columns>
<asp:BoundFiel d ItemStyle-CssClass="ItemS tyle" />
</Columns>
</asp:GridView>

All gridview in my apps have only one column (empty) with the style
applied... It seems that when <Columnsis defined, it overrides all
colums definition in all pages...

Finally, the only way I found is to add the property to all columns
in all gridview in all pages which requires a lot of extra work....

Is there any way to reach my goal ?

Thanks,
Steve

Use RowStyle on the GridView, and remove the <Columstag.

By adding the <Columnstag, you are telling to all gridviews in your
applications to use this column defined in the skin. Obviously, that's
not what you want.

--

Riki

Jun 21 '07 #3
Steve B. wrote:
I don't want to target the row, but the cells.
I actually want to define this style :

ItemTemplate { border-top : solid black 2px;border-bottom : solid
black px }

If I apply this style to the row, it won't apply. I have to apply on
the cell (in fact, on the TD tag, not the TR).
In that case, modify the css class into:
ItemTemplate td { border-top : solid black 2px;border-bottom : solid black
px }

(note the addition of td after ItemTemplate).

This will apply the style to every td inside the tr that is targeted.

--

Riki
Jun 21 '07 #4

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

Similar topics

1
3024
by: Philipp Lenz | last post by:
I'm very confused about how this works, all the tutorials out there show me how to apply a skin to a webcontrol, but I want to know how I can access the components of a control....for example: I have a usercontrol, the ascx is defined like this: <%@ Control Language="C#" AutoEventWireup="true" CodeFile="Test.ascx.cs" Inherits="Spin.Test" %> <asp:Panel ID="Panel1" runat="server" Height="243px" Width="350px">
1
1309
by: Andre | last post by:
Hi, I'm using Visual Web Developer 2005 to create a .skin file. But i have a problem (i think) ;o) When editing my skin file, in the toolbox, i can only drag HTML controls.. the Server Control (In the Standard section of the toolbox) are disabled. In skin file we can only put server control, so, is it a problem or i'm missing something ?
1
3718
by: Alan Silver | last post by:
Hello, I am just converting a 1.1 web site to use version 2.0 of the framework and have run into a weird problem trying to add a skin file. I set up a theme, and moved the CSS file in there, no problem. I then changed one of the <img> tags in the master page to look like... <asp:Image ID="imgBsd" SkinId="imgBsd" runat="server" />
1
4070
by: Stephen Hatfield | last post by:
I am working on part of an application most of which is being developed outside of my group. I may actually have two problems here. I have a GridView for which the columns are generated dynamically from a manager class called by the code behind for the page containing the GridView. The grid appears to display properly. The HyperLinkField generated dynamically works just fine. This application has a default.skin file which sets AllowPaging...
2
11724
by: Jacksm | last post by:
How can I align an asp:table columns with gridview columns (the widths)? I have tried setting table.column(0).width = gridview.column(0).width at page_load but it doesn't work. Thanks in advance
1
2813
by: =?Utf-8?B?SGFycnkgS2Vjaw==?= | last post by:
I have a GridView that I dynamically add columns to in code. The way that my code is written, everything works properly if I use GridView.Columns.Add to simply add the columns to the end of the collection. However, if I use GridView.Columns.Insert to inject the columns in the middle of the existing columns, I see lots of exceptions when I page the GridView, because certain controls contained within the grid are mysteriously absent? Can...
2
5583
by: sivagururaja | last post by:
Hi All, How can i sorting the Gridview Columns via the code behind. When i tried to sorting the column it doesn't work. SqlConnection con = new SqlConnection("Connection string"); con.Open(); SqlCommand cmd = new SqlCommand(str, con); SqlDataAdapter da = new SqlDataAdapter(cmd);
8
5149
by: scotty | last post by:
Can a .skin file be created without visual studio? Thanks, Scott
2
2911
by: =?Utf-8?B?SmF5IFBvbmR5?= | last post by:
Based on wether a row is selected in a GridView I need to HIDE the last two columns of a gridview. I do NOT need to make the cells invisible I want to hide the entire column. When I set the Visible property on the columns it causes the underlying ObjectDataSource to re-issue the Select statement. How can I hide these columns without double clutching the ODS Select?
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
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...
1
10087
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6737
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
5380
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...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
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 we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
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.