this.entityModel.Entities
is a source to my datagrid(agdatagrid)
.
I have kept AutoGenerateColumns="False"
.
i have 6 columns in my agdatgrid
i want 6th column to be visible depending on the data of that column..ie., if any row of that column contains the data then it should be visible and if none of the row contains the data for that column it should be invisible.
So i have written a foreach loop but it takes more time to get ui loaded if the data is large. so is there any other way ?
foreach (BrowserEntity _browseEntity in this.entityModel.Entities)
{
if (_browseEntity.State != null && this.entityModel.Entities.Count>0)
{
this.grid.DataSource = this.entityModel.Entities;
this.grid.Columns[6].Visible = true;
break;
}
else
{
this.grid.DataSource = this.entityModel.Entities;
this.grid.Columns[6].Visible = false;
}
}