how to make datagrid Visibility is Collapsed in codebehind

Posted by prince23 on Stack Overflow See other posts from Stack Overflow or by prince23
Published on 2010-05-14T08:15:08Z Indexed on 2010/05/14 11:14 UTC
Read the original article Hit count: 164

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

© Stack Overflow or respective owner

Related posts about silverlight-4.0

Related posts about Silverlight