Wrox Programmer Forums
|
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 December 12th, 2008, 05:29 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default GridView Column Editing

I have a GridView that shows 0.00 in columns. I would like those columns to show nothing. Is there a way to supress the 0.00 using the DataFormatString property setting? Thank you.
 
Old December 12th, 2008, 05:39 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You can use the RowDataBound event to manipulate the cell data:

http://msdn.microsoft.com/en-us/libr...databound.aspx

Question: why don't you manipulate this data prior to binding it to the gridview? For example, if you are pulling the data from SQL Server why not modify the Sproc to return an empty string instead of 0.00?

hth.
-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
 
Old December 12th, 2008, 05:46 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Doug,

Rows in columns show good numeric data, user just do not want to see zeros.
 
Old December 12th, 2008, 06:06 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

This makes no sense:
Rows in columns show good numeric data

Columns do not contain rows (unless you have some sort of nested table), rows contain columns. Are you saying that the RowDataBound event won't work for you?

-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
 
Old December 15th, 2008, 08:59 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Doug, I followed you suggestion and edited column values in my stored procedure. Thank you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing all GridView rows Abbas ASP.NET 2.0 Professional 4 March 3rd, 2012 02:19 PM
bulk editing in gridview tam_soft ASP.NET 2.0 Basics 0 November 27th, 2007 04:49 AM
how can i do in place editing in gridview barunvicky BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 September 7th, 2007 10:55 AM
editing and updating a gridview sarah lee ASP.NET 2.0 Basics 2 December 22nd, 2006 05:45 AM
Editing all GridView rows Abbas C# 2005 0 November 29th, 2006 03:52 PM





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