using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
using System.Drawing;
using System.Linq;

public enum UserType
{
    Default = 1,
    Parameters = 2,
    Students = 3,
    Marks = 4,

}
public partial class Default : System.Web.UI.Page 
{
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        RadGrid2.NeedDataSource += new GridNeedDataSourceEventHandler(RadGrid2_NeedDataSource);
    }

    void RadGrid2_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        UserType type = new UserType();
        string[] types = Enum.GetNames(typeof(UserType));
        DataTable table = new DataTable();
        table.Columns.Add("Names");
        table.Columns.Add("Values");
        foreach (int i in Enum.GetValues(typeof(UserType)))
        {
            UserType parsedEnumValue = (UserType)Enum.Parse(typeof(UserType), i.ToString());
            table.Rows.Add(parsedEnumValue.ToString(), i.ToString());
        }

        RadGrid2.DataSource = table;
    }

  
}
