Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6145545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:48:30+00:00 2026-05-23T18:48:30+00:00

I have one DataTable like this: Attribute Percentage ReferenceAmount TaxAmount ———— ———— —————- ———–

  • 0

I have one DataTable like this:

Attribute          Percentage      ReferenceAmount        TaxAmount
------------       ------------     ----------------      -----------
  Sales              5.00             5000                  250
  VAT                2.00             250                   5
  Discount            0                 0                   100

I want to Bind this DataTable with one GridView.
But in the GridView, I dont want to display 0. Instead of Zero, I just want leave that cell as empty. I dont want to display any other thing if that contains Zero.
How to replace EmptyString instead of Zero in the DataTable?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:48:30+00:00Added an answer on May 23, 2026 at 6:48 pm

    The following GridView DataBound method will loop through every cell in the GridView and replace “0” with an empty string:

            protected void GridView1_DataBound(object sender, EventArgs e)
            {
                foreach (GridViewRow row in GridView1.Rows)
                {
                    for (int i = 0; i < row.Cells.Count - 1; i++)
                    {
                        if (row.Cells[i].Text == "0")
                        {
                            row.Cells[i].Text = "";
                        }
                    }
                }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JSF datatable like this one: <h:form id=productsBox> <h:dataTable var=product value=#{categoriesBean.category.products} id=productsTable>
I have a DataTable like this name age ------------ kumar 27 kiran 29 anu
I have found some similar questions like this one, however there are so many
I have a function like this in one of my classes and then I
I have a table in SQL Server that is structured like this: id Name
The scenario is like this. I have a rich:tabPanel with about 5 tabs. On
I have a table called Shoppings in my SQL db. This one has a
I have one field that I need to sum lets say named items However
I have one thread that writes results into a Queue. In another thread (GUI),
I have one hibernate sequence, that generates all sequence-numbers in my app. When I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.