using System;
using System.ComponentModel;
using System.Security;
using System.Security.Permissions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

[assembly: TagPrefix("CustomControls.AspNet", "CustomControl")]
namespace CustomControls.AspNet
{
	public class CustomGrid : WebControl
	{
		public RadGrid Grid { get; set; }
		public CustomGrid()
		{
			RadGrid RadGrid1 = new RadGrid();
			RadGrid1.ID = "RadGrid2";

			RadGrid1.DataSourceID = "SqlDataSource1";

			RadGrid1.Width = Unit.Percentage(100);
			RadGrid1.PageSize = 5;
			RadGrid1.AllowPaging = true;
			RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;
			RadGrid1.AutoGenerateColumns = false;
			RadGrid1.GroupingEnabled = true;
			RadGrid1.ShowGroupPanel = true;
			RadGrid1.ShowStatusBar = true;
			RadGrid1.ClientSettings.AllowDragToGroup = true;

			RadGrid1.MasterTableView.PageSize = 15;

			GridBoundColumn boundColumn;
			boundColumn = new GridBoundColumn();
			boundColumn.DataField = "CustomerID";
			boundColumn.HeaderText = "CustomerID";
			RadGrid1.MasterTableView.Columns.Add(boundColumn);

			boundColumn = new GridBoundColumn();
			boundColumn.DataField = "ContactName";
			boundColumn.HeaderText = "Contact Name";
			RadGrid1.MasterTableView.Columns.Add(boundColumn);

			this.Grid = RadGrid1;
			this.Controls.Add(RadGrid1);
		}

		public void InstantiateIn(System.Web.UI.Control container)
		{
			
		}

	}
}