protected void Page_PreRender(object sender, EventArgs e) { gridFooter.Visible = PG.Visible && PG.Rows.Count > 0; if (!Page.IsPostBack && gridFooter.Visible) { ProductAssignment.ClearSelection(); ListItem item = ProductAssignment.Items.FindByValue(AssignmentStatus); if (item != null) { item.Selected = true; } PG.DataBind(); } }
protected void PG_DataBound(object sender, EventArgs e) { if (!Page.IsPostBack) { if (PG.Rows.Count == 0) { ProductAssignment.ClearSelection(); ListItem item = ProductAssignment.Items.FindByValue("Any"); if (item != null) { item.Selected = true; } PG.DataBind(); } } }