D Daves Mar 19, 2005 #1 how can I set my DataList so that the HeaderItem is not displayed if the list is empty?
B Brock Allen Mar 19, 2005 #2 how can I set my DataList so that the HeaderItem is not displayed if the list is empty? Click to expand... You have to code this manually. I tend to do something like this: _dataList.DataSource = ds; _dataList.DataBind(); if (_dataList.Items.Count == 0) { _dataList.Visible = false; _myInfoLabel.Text = "No Records Found"; } -Brock DevelopMentor http://staff.develop.com/ballen
how can I set my DataList so that the HeaderItem is not displayed if the list is empty? Click to expand... You have to code this manually. I tend to do something like this: _dataList.DataSource = ds; _dataList.DataBind(); if (_dataList.Items.Count == 0) { _dataList.Visible = false; _myInfoLabel.Text = "No Records Found"; } -Brock DevelopMentor http://staff.develop.com/ballen