Wrox Programmer Forums
|
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components 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 6th, 2004, 03:18 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default changing datagrid row color

Hi

I am working on .NET.I am displaying database records (ex prodid,desc,price,qty,level ) in datagrid.In a perticular condition like if level=1 only i want to change the entire perticular row color?

thanks


 
Old July 6th, 2004, 04:42 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

You can use if statement for this

Love 4 all
 
Old August 4th, 2004, 06:42 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

 dim colorTd
 colorTd = ""
 sql = "some statement"
 getInfo = conn.execute(sql)

 response.write "<table>"

 do until getInfo.EoF
    if ((count/2)==0) then
       colorTr = "#EDEACC"
    else
       colorTr = "#FFFFFF"
    end if
    count = count + 1

    response.write "<tr bgcolor=" & colorTr & "><td>stuff</td></tr>"
    getInfo.moveNext
  loop
  response.write "</table>"

This code should cut n paste sweetly all you need to do is get a record set.




Wind is your friend
Matt
 
Old August 5th, 2004, 07:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You would get better responses if you posted in the ASP.NET forum. Look up template columns.

 
Old August 5th, 2004, 10:58 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

stu9820

Did the code not work? Sounded like a fairly simple row color change -
wow .net doesnt use tables?

Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing color of page-numbers in DataGrid anup_daware ASP.NET 1.0 and 1.1 Basics 2 October 18th, 2007 07:04 AM
Datagrid row color changing - windows vb.net app badgolfer VS.NET 2002/2003 7 April 18th, 2007 02:32 PM
how can i change row color in datagrid? berzegerol VS.NET 2002/2003 3 October 31st, 2006 09:08 AM
datagrid row color change berzegerol Visual Studio 2005 0 October 18th, 2006 06:33 AM
One for the gurus - grid row color changing badgolfer VS.NET 2002/2003 1 February 20th, 2004 12:23 AM





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