using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class portailbourse : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
		if (!this.IsPostBack)
		{
			MenuItem Root = new MenuItem("Choisir un mode");

			foreach (WebPartDisplayMode mode in MyPartManager.DisplayModes)
			{
				if (mode.IsEnabled(MyPartManager))
				{
					Root.ChildItems.Add(new MenuItem(mode.Name));
				}
			}

			PartsMenu.Items.Add(Root);
		}
    }

	protected void PartsMenu_MenuItemClick(object sender, MenuEventArgs e)
	{
		foreach (WebPartDisplayMode mode in MyPartManager.DisplayModes)
		{
			if (mode.Name.Equals(e.Item.Text))
			{
				MyPartManager.DisplayMode = mode;
			}
		}
	}

	protected void GridView1_Load(object sender, EventArgs e)
	{
		GenericWebPart part = (GenericWebPart)GridView1.Parent;
		part.Title = "Liste complète des cours";
	}

	protected void GridView2_Load(object sender, EventArgs e)
	{
		GenericWebPart part = (GenericWebPart)GridView2.Parent;
		part.Title = "Les grands de la liste";
	}
}
