CodeVerge.Net Beta
Login Idy
Register Password
  Forgot?
Explore    Item Entry    Members   
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML





Zone: > NEWSGROUP > Asp.Net Forum > microsoft_downloads.css_friendly_control_adapters Tags:
Item Type: NewsGroup Date Entered: 4/22/2007 1:49:58 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 5 Views: 22 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
6 Items, 1 Pages 1 |< << Go >> >|
diosloco
Asp.Net User
Applying CSS to an ImageField in a GridView4/22/2007 1:49:58 AM

0/0

I have 3 small images being displayed in my GridView. One image is too tall for a row and so the row height is bigger then I would like it to be. Of course CSS is the answer. And before the adapters, I had a solution that worked (shorten for your viewing pleasure).

<asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" OnRowDataBound="GridView1_RowDataBound" EnableViewState="false" CssClass="GridView">
<Columns>
<asp:ImageField ... ControlStyle-CssClass="GridView-ControlStyle" />

This creates a nice tag like <img class="GridView-ControlStyle" ... />

But when I switched to the adapters, my ControlStyle CSS specification was lost. I tried doing something like

.GridView table tbody tr td image
{
    height:32px;
}

but this doesn't work because I have other images in other columns of the GridView.

 

So is there a solution to this? Is this a bug? Or am I missing something?

Thanks.

Liming
Asp.Net User
Re: Applying CSS to an ImageField in a GridView4/22/2007 6:07:10 AM

0/0

adapater shouldn't effect the control inside i'd think? as it has nothign to do with the adapater...  I never used "controlStyle-cssclass".. what if you just try CssClass?

 


Liming Xu
Jumptree ASP.NET 2.0 Project Management - For the Open Source Community and Effectively Manage Projects/Tasks/Milestones
diosloco
Asp.Net User
Re: Applying CSS to an ImageField in a GridView4/22/2007 10:26:53 PM

0/0

CssClass cannot be set from ImageField in a GridView. In said ImageField, ItemStyle-CssClass sets the style for the <td> element, ControlStyle-CssClass sets the style for the <img> tag.
bdemarzo
Asp.Net User
Re: Applying CSS to an ImageField in a GridView4/23/2007 1:48:30 PM

0/0

You could make a version of the image that is of the appropriate height and use that image in your GridView. Relying on CSS to resize an image is generally preferable to having the image the size you want in the first place.

- brian
- blog: www.sidesofmarch.com
diosloco
Asp.Net User
Re: Applying CSS to an ImageField in a GridView4/24/2007 4:52:48 PM

0/0

I get my image URLs from an external source and do not store a local copy. Given that, I have no control over the image size. So while you present a possibly reasonable workaround for some developers, it isn't one that I can execute and more importantly, it's a workaround, not a solution.

BTW: It also strips the HeaderStyle-CssClass and the FooterStyle-CssClass. HeaderStyle-CssClass is useful to me if I want to have one header cell look different than the others because it is sortable.

Liming
Asp.Net User
Re: Applying CSS to an ImageField in a GridView4/24/2007 7:38:14 PM

0/0

what you can do is to use a templateField and inside the templatefield, use a regular asp:image with the css you want. that ought to fix it.
Liming Xu
Jumptree ASP.NET 2.0 Project Management - For the Open Source Community and Effectively Manage Projects/Tasks/Milestones
6 Items, 1 Pages 1 |< << Go >> >|



Search This Site:


Meet Our Sponsors:



Other Resources:

Test. Delete me. - novell.support.zenworks.software-package-management ... css formatting in my masterpage. setting menu static and dynamic menus to be the same width. change menu in master page. applying css to an imagefield in a gridview ...
Installing SSL Certificate - novell.devsup.exappserver - Web ... Installing SSL Certificate, > ROOT > NEWSGROUP > Novell Forums > novell.devsup.exappserver, ... applying css to an imagefield in a gridview. help pls.. treeview ...
Applying CSS to an ImageField in a GridView - ASP.NET Forums Applying CSS to an ImageField in a GridView. Last post 06-14-2008 5:50 AM by Anneleen. ... Re: Applying CSS to an ImageField in a GridView. 04-22-2007, 2:07 AM ...
CSS Friendly Control Adapters CSS Friendly Control Adapters. Re: Applying CSS to an ImageField in a GridView ... Re: Applying CSS to an ImageField in a GridView. Re: Applying CSS to an ...
Links to functions in the CS file inside a GridView <asp:ImageField DataAlternateTextField="imageLocation" DataImageUrlField="imageLocation" ... Css in theme not applying in VS2005. using cdosys.asp for form mail ...
.NET ASP Page 7 - Bytes Site Map GridView Select Row By DataKey. How do I do asynchronous tasks in ... MasterPages and applying CSS to content pages. localiztion app_localresources ie6 vs ie7 ...
.NET ASP Page 60 - Bytes Site Map How do I get asp:ImageField to use a hyperlink? Response.Redirect triggers ... Missing CSS problem. Caching HTML. help on xml response. Problem with GridView ...
Test. Delete me. - novell.support.zenworks.software-package-management ... css formatting in my masterpage. setting menu static and dynamic menus to be the same width. change menu in master page. applying css to an imagefield in a gridview ...
asp2 0 image field in gridview + asp.net2.0. Google. Page 1 ... code for applying string data type to range validator in asp.net2.0 c#. Google. Page 1 ...
Free Web Development Training and Tutorials Blog :: general GridView, DetailsView, and FormView <asp:GridView> Control <asp:ImageField> Control ... Applying CSS Style Sheets. Basic Data Binding. Binding Hierarchical Data ...


 
All Times Are GMT