Datalist header

  • Thread starter Thread starter Daves
  • Start date Start date
how can I set my DataList so that the HeaderItem is not displayed if
the list is empty?

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
 
Back
Top