how to make datagrid Visibility is Collapsed in codebehind
- by prince23
hi
i have data grid.
now here i am checking the condition if Companyrows.count is zero . if count is zero make data grid.visible is false.
List<Employee> Companyrows = new List<Employee>();
if (Companyrows.Count == 0)
{
dgrdRowDetail.Visibility = "Collapsed";
// getting error
// convert type 'string' to 'System.Windows.Visibility'
}
else
{
dgrdRowDetail.ItemsSource = Companyrows;
}
any help how to solve this issue would be great
thank you