Wrox Programmer Forums
|
BOOK: Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages ISBN: 978-0-470-12448-2
This is the forum to discuss the Wrox book Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages by Jacob J. Sanford; ISBN: 9780470124482
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages ISBN: 978-0-470-12448-2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 8th, 2008, 08:06 PM
Registered User
 
Join Date: Jul 2008
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 5 GridView Selected Item

On page 175 of chapter 5, the background of red (#FF0000) for a Selected row only works on normal rows but is not working for alternate rows! How do I correct this problem?

Thanks,

Jim
 
Old August 6th, 2008, 05:51 PM
Wrox Author
 
Join Date: Sep 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to surfer5 Send a message via AIM to surfer5 Send a message via MSN to surfer5 Send a message via Yahoo to surfer5
Default

Hey Jim (again :))-

Can you post your CSS and ASPX code? I am hoping its just something small and, if I can see what you have going on, I might be able to figure it out.

You can also try downloading the code for chapter 5 here:

http://media.wiley.com/product_ancil.../Chapter_5.zip

There you might be able to see if the original code works in your environment or not. That can help us figure out what's breaking.

Thanks!

-Jacob



Jacob J. Sanford
Author of Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages
Co-author of Professional SharePoint 2007 Design
 
Old August 8th, 2008, 03:11 PM
Registered User
 
Join Date: Jul 2008
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Jacob,

Thanks for responding.

I downloaded the chapter5 code and my code looks the same. I tried to even replace my CSS file with your CSS file and I still have the same problem. Interestingly, your chapter5 code works correctly! In my project, when I click [u]Select</u> on an Alternating row, the row takes on the color of the Normal rows instead of the "Selected" color. The "Selected" color works fine on the Normal rows. I don't understand it.

Here is my aspx code:

Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GridView.aspx.cs" Inherits="GridView" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>GridView Example Page</title>
    <link href="myGridView.css" rel="stylesheet" type="text/css" />
    <link id="Link1" href="~/CSS/Import.css" rel="Stylesheet" type="text/css" runat="server" />
    <!--[if lt IE 7]>
       <link runat="server" rel="stylesheet" type="text/css" href="~/CSS/BrowserSpecific/IEMenu6.css" />
    <![endif]-->   
</head>
<body>
    <form id="form1" runat="server">
      <div>
        <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/GridviewSource.xml">
        </asp:XmlDataSource>
        <br />
        <asp:GridView CssSelectorClass="PrettyGridView" AllowPaging="true" PageSize="3" ToolTip="example" ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="XmlDataSource1">
            <Columns>
                <asp:CommandField ShowSelectButton="true" />
                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                <asp:BoundField DataField="URL" HeaderText="URL" SortExpression="URL" />
            </Columns>
        </asp:GridView>
      </div>
    </form>
</body>
</html>
Jim





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get selected item from listview? try.test.abc C# 1 January 4th, 2007 02:34 AM
How Refer to Selected Item in DataGrid Morfoman General .NET 0 September 20th, 2005 11:41 AM
re: DataGrid Selected Item from outside grid vids ASP.NET 1.x and 2.0 Application Design 1 May 2nd, 2005 04:12 PM
Datagrid - Scroll to selected item rodmcleay ASP.NET 1.0 and 1.1 Professional 2 February 21st, 2005 08:36 PM
How to get selected Item from Listbox? Iceman571 ADO.NET 1 March 25th, 2004 06:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.