private void SetMasterPagesGrid() { try { List <Hemrika.SharePresence.WebSite.Master.MasterPage> masters = serviceMasterPages.GetMasterPages(); //foreach (Hemrika.SharePresence.WebSite.Master.MasterPage master in masters) for (int i = 0; i < masters.Count; i++) { Hemrika.SharePresence.WebSite.Master.MasterPage master = masters[i]; if (master.Name == "minimal.master" || master.Name == "default.master" || master.Name == "v4.master") { masters.Remove(master); } } if (masters.Count > 0) { gridMasterPages.DataSource = masters; gridMasterPages.DataBind(); } } catch (Exception ex) { ex.ToString(); } }