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

  • SEARCH
  • Home
  • 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 762179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:55:36+00:00 2026-05-14T15:55:36+00:00

I have datatable table like id name address phoneno 1 abc kfjskl 798798 2

  • 0

I have datatable table like

id name address phoneno 
1  abc  kfjskl  798798
2  bcd  kjdsfl  808909
3               899009
   fjsh kjllkjl
5  jfkd 

And I am displaying this value in the datagridview by code

dataGridView1.ColumnCount = Table.Columns.Count;
dataGridView1.RowCount = Table.Rows.Count;
for (int i = 0; i < dataGridView1.RowCount; i++)
{
    for (int j = 0; j < dataGridView1.ColumnCount; j++)
    {
        dataGridView1[j, i].Value = Table.Rows[i][j].ToString();
    }
}

Now I don’t want to display row that has some missing value like If I will do that then the datagridview will look like

 1  abc  kfjskl  798798
 2  bcd  kjdsfl  808909

How can I do that ?

  • 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-14T15:55:36+00:00Added an answer on May 14, 2026 at 3:55 pm

    This will do what you need (I think):

    dataGridView1.ColumnCount = Table.Columns.Count;
    for (int i = 0; i < Table.Rows.Count; i++)
    {
        bool valueMissing = false;
        DataGridViewRow row = new DataGridViewRow();
        for (int j = 0; j < dataGridView1.ColumnCount; j++)
        {
            if (Table.Rows[i][j].ToString() == "")
            {
                valueMissing = true;
                break;
            }
            else
            {
                row.Cells[j].Value = Table.Rows[i][j];
            }
        }
        if (!valueMissing)
        {
            dataGridView1.Rows.Add(row);
        }
    }
    

    This may need to be modified to check for null values in Table.Rows[i][i] (in addition to just checking for empty string values).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a data table like: <h:dataTable id=box-score-away value=#{individualAwayBoxScoreQuery.resultList} var=_bssl> <f:facet name=header> <h:outputText value=Away
If I have a data table like this id, Name, Address, Status How would
If I have the name of a database table like this: string tableName =
I have a DataTable which is generated from .xls table. I would like to
I have a SP with 20 select queries. Each query is table-name-aliased like below.
I have a table in SQL Server that is structured like this: id Name
I'm a bit confused on this. I have a data table structured like this:
I have a DataTable which I want to save to a SQLite Database Table.
I have one datatable. In that table I have columns named [Total Day], [Present
I have a method private static DataTable ParseTable(HtmlNode table) and sometimes this method has

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.