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 6325383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:53:10+00:00 2026-05-24T16:53:10+00:00

I have a custom GridView that will show 6 rows of data as a

  • 0

I have a custom GridView that will show 6 rows of data as a default (regardless of how many rows) with a pager at the bottom. This Gridview is used for numerous unique pages. On one page, I have a column that I set to hidden (width 0 and Css-Display=none) that I need — another part of program depends on it being set that way.

The column is NOT visible in rows where there is data (as it shouldn’t be). However, the column is showing up in the empty rows as an empty column (should not be visible). How would I go about making the EMPTY rows hide the COLUMN as well?

  • 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-24T16:53:12+00:00Added an answer on May 24, 2026 at 4:53 pm

    In my GridView_DataBound function, the cells were being generated for each column that existed — how it filled in the empty cells. I added the if statement to check if the field was supposed to be hidden, and ensure the autogenerated cell was hidden as well.

    foreach (DataControlField field in _gridView.Columns)
    {
        TableCell cell = new TableCell();
        cell.Text = " ";
    
        if (field.ItemStyle.CssClass == "hideGridColumn")
            cell.Visible = false;
    
        row.Cells.Add(cell);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a GridView that displays several dozen rows worth of a custom layout,
I have a list view that is displaying data using the gridview. This list
I have a custom component, ExportCommandButton, that has two attached properties. This component is
I have a custom view subclassed from GridView that I use in order to
I have a GridView that use a stored procedure for custom paging and sorting
I have an ASP.NET GridView which has columns that look like this: | Foo
I have a gridview that has its DataSourceID property set to a custom ObjectDataSource
I have a gridview that displays the results of a custom query. The number
I have a custom gridview control that extends the standard asp.net gridview control. The
I have a gridview that is databound to a list of custom objects. On

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.