Unable To set row visible false of a datagridview

后端 未结 6 1615
北荒
北荒 2020-11-27 05:55

I have a DataGridView where I set DataSource:

taskerEntities te = new taskerEntities();
var OMsMasterDescriptiveIndicators = te.MyT         


        
6条回答
  •  情歌与酒
    2020-11-27 07:01

    Example

            foreach (DataGridViewRow rw in dataGridView1.Rows)
            {
    
            if (rw.Cells[14].Value.ToString() == "") // this Cell have a TEXT, 
                {
                    CurrencyManager currencyManager1 = (CurrencyManager)BindingContext[dataGridView1.DataSource];
                    currencyManager1.SuspendBinding();
                    rw.Visible = false; 
                    currencyManager1.ResumeBinding();
    
                }
            }
    

    this show only the row that have in the cell index 14, if this is blank or empty the whole row not show

提交回复
热议问题