CSS Control Adapter for Gridview

I am tryin to style a gridview.My site is using CSS Friendly control adapter. I am new to this. Can u guys pls help me make the gridview look better. Every time i add a div tag,i get an error that div is not a property of the gridview.If i put it to envelope the gridview, nothin happens!!

 

Thanks. 

0
Sylviarabi
4/25/2008 8:53:05 PM
asp.net.css-control-adapters 905 articles. 0 followers. Follow

4 Replies
868 Views

Similar Articles

[PageSpeed] 31

If you left the (ID) of the GridView as GridView1 then you should be able to find <div class="AspNet-GridView" id="GridView1"> in the source when you run the page.   You can use the class to style the GridView.  You should also be able to find other classes throughout the source. 

If you changed the (ID) of the GridView, you can still check the source to see what classes to style.

If your page source is not showing any classes, then I expect your adapters are not installed correctly. 

0
ChibiNopo
4/26/2008 12:45:20 AM

 i do not see the classes in the source code. My website is not a CSS friendly website but there is a reference added to CSS Friendly. Also there is a CSSControlAdapters.Browser in App_Browsers.

Is there a way I can define and use classes in CSS to style this Gridview? 

0
Sylviarabi
4/28/2008 3:45:05 PM

 This is wat i have done so far:

my style sheet has:

.GridViewStyle
{  
    border-right: 2px solid #A7A6AA;
    border-bottom: 2px solid #A7A6AA;
    border-left: 2px solid white;
    border-top: 2px solid white;
    background-color:Green;
    padding: 4px;
}

.GridViewStyle a
{
    color: #FFFFFF;
}

.GridViewHeaderStyle th
{
    border-left: 1px solid #EBE9ED;
    border-right: 1px solid #EBE9ED;
}

.GridViewHeaderStyle
{
    background-color: #5D7B9D;
    font-weight: bold;
    color: White;
}

.GridViewFooterStyle
{
    background-color: #5D7B9D;
    font-weight: bold;
    color: White;
}

.GridViewRowStyle
{
    background-color: #F7F6F3;
    color: #333333;
}

.GridViewAlternatingRowStyle
{
    background-color: #FFFFFF;
    color: #284775;
}

.GridViewRowStyle td, .GridViewAlternatingRowStyle td
{
    border: 1px solid #EBE9ED;
}

.GridViewSelectedRowStyle
{
    background-color: #E2DED6;
    font-weight: bold;
    color: #333333;
}

.GridViewPagerStyle
{
    background-color: #284775;
    color: #FFFFFF;
}

.GridViewPagerStyle table /* to center the paging links*/
{
    margin: 0 auto 0 auto;
}

The main page has:

 <asp:Content ID="AHSOEntranceContent" ContentPlaceHolderID="main_content" Runat="Server">
<h1>Tables</h1>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="CaseID" DataSourceID="SqlDataSource1" CssClass="GridViewStyle">
    <FooterStyle CssClass="GridViewFooterStyle" />
    <RowStyle CssClass="GridViewRowStyle" />   
    <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
    <PagerStyle CssClass="GridViewPagerStyle" />
    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
    <HeaderStyle CssClass="GridViewHeaderStyle" /><Columns>
            <asp:BoundField DataField="CaseID" HeaderText="Case ID" InsertVisible="False" ReadOnly="True"
                SortExpression="CaseID" />
            <asp:BoundField DataField="AHSOUserWhoAssignedCase" HeaderText="Manager"
                SortExpression="AHSOUserWhoAssignedCase" />
            <asp:BoundField DataField="VerifiedAccusedStudentUIN" HeaderText="Student UIN"
                SortExpression="VerifiedAccusedStudentUIN" />
            <asp:BoundField DataField="VerifiedAccusedStudentFullName" HeaderText="Student Full Name"
                SortExpression="VerifiedAccusedStudentFullName" />
            <asp:BoundField DataField="StudentClassification" HeaderText="Classification"
                SortExpression="StudentClassification" />
            <asp:BoundField DataField="CaseStatus" HeaderText="CaseStatus" SortExpression="Case Status" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AHVIOSConnectionString %>" SelectCommand="sp_Get_Case_By_CaseID" SelectCommandType="StoredProcedure">
        <SelectParameters>
            <asp:Parameter DefaultValue="220" Name="CaseID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
            

</asp:Content>

The style sheet is inluded into the master page as:

<link rel="stylesheet" type="text/css" media="print" href="includes/css/tamuPrint.css" />

 

The gridview is still unformatted.Please help me sort this. Thanks 

0
Sylviarabi
4/28/2008 4:25:15 PM

Is there a CSSFriendly.dll file in your Bin folder?

 

0
ChibiNopo
4/29/2008 1:49:40 AM
Reply:

Similar Artilces:

Is CSS Control Adapters compatible with WebPart and WebPartZone controls?
Both WebPart and WebPartZone ultimately derive from WebControl, so it seems like this would work, but before I got into it deeply, was curious if anyone had tried it and if there are any issues? I don't think there is an esay way to make it works. This was a reply from Scott Guthrie: Unfortunately I don't think there is a super easy way to override WebParts -- since some of the layout does assume tables (since the CSS to-do this positioning with divs isn't super easy).  We are going to look at whether it is possible to build another control adapter for webparts in the f...

What is the advantage of the CSS control adapter for the gridview?
 The Grid View has built in styling capabilities with the "HeaderStyle-CssClass" and the "ItemStyle-CssClass" attributes.  Why sould someone want to use the CSS Friendly Control Adapter for this if it has this built in capability?  The html that it produces via the adapter doesn't seem that much better than the html that it produces normally.  Is the only reason to use the adapter on the Grid View so that the output can be manually changed?  For instance,  the table that is put out by the Grid View can canged into <divs>.  ...

Reagrding using FILTER in (MenuExample.css) CSS adapter classes for Menu control
Hello everyone, Whenever I use filter: in any of the CSS calss for the MENU control using CSS adapters, it only renders the first level of the menu, all subsequent levels are not even displayed. I want to use filter for some transparency effect, but using it is not rendering any child menu's. Following is a example - .PrettyMenu .AspNet-Menu-Vertical { position:absolute; top: 87px; left: 0px; width:200px; z-index: 300; filter:alpha(Opacity=50); } Now it only shows first level and rest of the menus are not displayed, if I remove filter, it works fine but without transparency. Rep...

CSS Control Adapters
I was thinking to implement menu like on www.auctiva.com using CSS Control Adapters. How would I do it?The enu would have two bars:1) Main bar - tabs 2 Second bar with submenu items, all links horizontallyRafal Zikbay.com - Free Classifieds (Search Over 5 mln jobs on Zikbay.com) DNN Direct Anybody can help?Rafal Zikbay.com - Free Classifieds (Search Over 5 mln jobs on Zikbay.com) DNN Direct ...

CSS control adapters
I've just seen another thread mentioning these which reminded me that I couldn't install the blighters. A couple of questions first tho.  The VSI file that I download won't load/install, it comes up with "string cannot have zero length".  ANybody any ideas on what may be going wrong? Second question is on how these get deployed on my remote server, will I be able to use them without access to the core asp library directories (if that makes sense). To fix the VSI installer problem, see this posting, http://forums.asp.net/thread/1492405.aspx. To deploy the adapters you do not ...

CSS Friendly Control Adapters + GridView + Update Panel = Problem
Hi everyone,I'm using a gridview control that's bound to an object data source.  I have a couple of controls to filter the data in the gridview, and I'm able to sort and page through the data. Placing it in an UpdatePanel gives me partial page rendering and the whole page doesn't refresh - Great.  Expected behaviour and it all works very well. However, introduce a Control Adapter into the mix (http://www.asp.net/cssadapters/) and Update Panel doesn't work at all - with the whole page refreshing. If anybody can offer any help, I'd be very grateful.  I want both A...

Trouble controlling .net controlls with CSS
 I am trying to control the :hover css property on <asp: Button> controls. Basically the css is working correctly to set the initial look of the button, but nothing is happening when I hover over the button. Here is my code:CSS:.sidebarButton{    width: 168px;     height: 45px;     background-color: #666666;     text-align: left;    font-weight: bold;    font-family: Century Gothic;    font-size: 13pt;    color: White;    border-style: none;  ...

CSS Friendly Control Adapters not support dynamically created rows in GridView?
I have a dynamically created row in GridView control. But it will not appear when I use CSS Friendly Control Adapter. I have to set adapterenabled=false to make it work. But I will loss all the table style in this way. Any better ideas to solve this problem? This is the code behind to add a new row.protected void GridView3_RowDataBound(object sender, GridViewRowEventArgs e) {GridViewRow insertedRow = new GridViewRow(GridView3.Rows.Count, GridView3.Rows.Count, DataControlRowType.DataRow, DataControlRowState.Normal); TableCell cell = new TableCell();cell.Text = " hello"; cel...

Atlas and gridview css control adapter doesn't work together
Hello.Gridview css control adapter doesn't work together. What can I do?The problem vanishes if I remove AJAX.The error is that when I click the Command buttons on gridview, nothing happenes!Thank you, Artashes  I think you are running into the issue that I posted about here: http://forums.asp.net/thread/1417511.aspx. You may find that the work arounds I posted will help.Russ HelfandGroovybits.com I have read that topic. Unfortunately, the workarounds, descirbed there, doesn't help. Is there a way for you to post a recipe (including markup and code, if needed) so I can rep...

CSS Adapters effecing other controls?
I'm using the css adapters to style the menu. It works fine. BUT: in other parts of the site, in pages without any css-friendly related stuff, menus and gridviews look wierd. Totaly different from the way they used to be before I added the css friendly adapters. I'm almost sure there is a connection. How can I make sure that a specific menu is NOT affected by the adapters? Thanks,Gili   I found this on the CSS Friendly adapters website whitepage: Disabling Adapters If you explicitly add AdapterEnabled="false" to your server-side tag, these sample adapters will attem...

Excluding control from CSS Adapter
I use menu in two places in the website: Main menu and User Menu. While I want to use CSS Adapter for Main menu, I do not want to use CSS Adapters for USer menu. It is the same tag in both places: asp:menu. Please helpRafal Zikbay.com - Free Classifieds (Search Over 5 mln jobs on Zikbay.com) DNN Direct  According to this book:  "...once you set up your adapters to run in your project, there is no real way to turn them off. It's not as if you can say "okay, GridView1, you use the adapters. But GridView2? No way; I want to style you myself" If they are on, t...

Wizard Control and CSS Adapters
Has anyone dealt with the wizard control and CSS Adapters?  I tried to create one myself, but it seems to mess with the datalist adapter already in place. If anyone has any thoughts or suggestions, that would be greatly appreciated. Thanks, Nichole...

TreeView and CSS Control Adapters
Hello All,I am using CSS control Adapter for my TreeView. The Intention is to emit <ul> and <li> tags instead of tables.But I am getting this error************************************************************************************** **************************************************************************************Server Error in 'xyz' Application. The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). Description: An unhandled exception occurred during the execution...

CSS Control Adapters #2
HiI have downloaded the CSS adapters from http://www.asp.net/cssadapters/, but how do I tell the menu to use the CSS? Cheers  Check this link http://www.asp.net/CSSAdapters/Default.aspx check the tab, "Help" -> "Tutorials" Another Link http://weblogs.asp.net/scottgu/archive/2006/05/02/CSS-Control-Adapter-Toolkit-for-ASP.NET-2.0-.aspxblog.budigelli.com Hey bopo, Ravi...Is totally right but sometimes a simple answer can really help. Once you have added the neccesary files to your project, in source view add (CssSelectorClass="PrettyMenu"&n...

Web resources about - CSS Control Adapter for Gridview - asp.net.css-control-adapters

GridView SelectedItem Binding Gotcha in WinRT
Last night when I was doing some WinRT hacking I was trying to setup databinding to the selected item in the GridView control and I ran into ...

CNW Group
Home Services Beyond the Wire About CNW Financials Webcasts Events My CNW All News Releases Advanced Search Gridview Latest News Releases All ...

CNW Group
... Services Beyond the Wire About CNW my CNW CNW Access CNW Directories Financials Webcasts Events my CNW All News Releases Advanced Search Gridview ...

CNW Group
Home Services Beyond the Wire About CNW Financials Webcasts Events My CNW All News Releases Add a Filter Gridview Latest News Releases All Today ...

New CmdLets of Powershell 2.0
New CmdLets of Powershell 2.0

Price Drop: Softbox
... objects- create product reflection- changing the background with something more interestingUse it as:- softbox- honeycomb softbox- gridview ...

Profile.aspx: ASP Alliance
.NET,ASP,ASP.NET,SQL,XML,HTML,ADO,ADO.NET,JavaScript,JScript,CSharp,VBScript and VB tutorials from AspAlliance.

Quick Answers - CodeProject
Questions - Free source code and tutorials for Software developers and Architects.; Updated: 25 Oct 2012

DotNetKicks.com - Upcoming stories
DotNetKicks.com is a community based news site edited by our members. It specialises in .NET development techniques, technologies and tools including ...

View Features - ExtendASP
Call 847-681-9827 or Request a Demo View Features Testimonials Pricing About Us Coming Soon ExtendASP exposes every feature, more than any other ...

Resources last updated: 1/21/2016 6:44:06 AM