Reputation: 7777
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
Upvotes: 0
Views: 1625
Reputation: 12735
"Collapsed" isn't it a string?
you have to declare the collapsed as following:
dgrdRowDetail.Visibility = Visibility.Collapsed;
Upvotes: 3