this.entityModel.Entities
은 내 datagrid(agdatagrid)
의 출처입니다.foreach 루프를 교체하거나 수정하는 것이 더 나은 솔루션
나는 AutoGenerateColumns="False"
을 유지했습니다. 나는 6 열을 내 agdatgrid
그 열의 데이터에 따라 6 번째 열을 표시하고 싶습니다. 그 열의 모든 행에 데이터가 포함되어 있으면 표시되어야하며 표시되지 않아야합니다. 행에는 보이지 않아야하는 해당 열의 데이터가 들어 있습니다.
그래서 foreach 루프를 작성했지만 데이터가 클 경우 ui가로드되는 데 더 많은 시간이 걸립니다. 다른 방법이 있습니까?
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;
}
}
나는 linq 쿼리로 갈 것입니다 내 이해 linq 쿼리가 빠른 teh foreach 루프 될 것입니다 .. u는 r 끝내 답변 주셔서 감사 Logged – Malcolm