protected void DataList1_ItemDataB(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { string strval = ((Label)(e.Item.FindControl("lblMP"))).Text; string month = ViewState["DateAdded"] as string; ; if (month == strval) { ((Label)(e.Item.FindControl("lblMP"))).Text = ""; e.Item.Visible = false; } else { month = strval; ViewState["DateAdded"] = month; ((Label)(e.Item.FindControl("lblMP"))).Text = month; Panel pnlMonth = (Panel)e.Item.FindControl("pnlMonth"); pnlMonth.Visible = true; e.Item.Visible = true; } } }