Datatable and Datagridview.

Posted by Harikrishna on Stack Overflow See other posts from Stack Overflow or by Harikrishna
Published on 2010-04-29T12:51:10Z Indexed on 2010/04/29 12:57 UTC
Read the original article Hit count: 336

Filed under:
|
|
|
|

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 ?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET