Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 June 27th, 2008, 02:37 AM
Authorized User
Points: 136, Level: 2
Points: 136, Level: 2 Points: 136, Level: 2 Points: 136, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2006
Location: London Town, , United Kingdom.
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default Replacing value with symbol in Gridview?

Hi,

I'm trying to replace the "status" value of a record in a GridView with a symbol but unsure how to go about it.

e.g. If the record has a status of "Inactive", then an asterisk[*] needs to appear next to the record; likewise a caret if is is "Featured".

Simple fix I know, just new to this game.. Any help greatly appreciated..

Hasta Luego..
KingRoon

DogFightClothing. No dogs. No fighting.
http://www.dogfightclothing.com
__________________
Hasta Luego..
KingRoon

DogFightClothing. No dogs. No fighting.
http://www.dogfightclothing.com
 
Old July 6th, 2008, 08:11 AM
Authorized User
Points: 198, Level: 3
Points: 198, Level: 3 Points: 198, Level: 3 Points: 198, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2008
Location: singapore, singapore, Singapore.
Posts: 54
Thanks: 0
Thanked 4 Times in 4 Posts
Default

you can do this in rowdatabound event. get the row and find the cell you want then replace the cell text with * or caret as you wish

the following code i have take from one of my .vb file. it is for understanding purpose only do your changes wherever required

    Protected Sub grvSearch_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grvSearch.RowDataBound
        Dim lblEvent As Label
        If (e.Row.RowType = DataControlRowType.DataRow) Then
            lblEvent = DirectCast(e.Row.Cells(0).Controls(1), Label)
            lblEvent.Text = "*"

        End If
    End Sub

Pon Saravanan
http://www.vbknowledgebase.com
 
Old July 7th, 2008, 09:46 AM
Authorized User
Points: 136, Level: 2
Points: 136, Level: 2 Points: 136, Level: 2 Points: 136, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2006
Location: London Town, , United Kingdom.
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Cheers Pon :)

Hasta Luego..
KingRoon

DogFightClothing. No dogs. No fighting.
http://www.dogfightclothing.com




Similar Threads
Thread Thread Starter Forum Replies Last Post
& symbol does not show up. chobo2 C# 2 August 29th, 2008 08:06 PM
pound symbol in XSL Velissarios XSLT 15 January 19th, 2006 02:16 PM
cannot resolve symbol (struts) tomeksupergosc J2EE 2 November 23rd, 2004 01:19 PM
dual use of the + symbol Martyn JSP Basics 0 February 19th, 2004 07:35 AM





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