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;

public partial class Default : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            DefineGrid();
        }

    }
    private void DefineGrid()
    {
        GridBoundColumn boundcolumn = null;
        GridHyperLinkColumn hypercolumn = null;
        hypercolumn = new GridHyperLinkColumn();
        this.RadGrid1.Columns.Add(hypercolumn);
        hypercolumn.HeaderText = "Edit";
        hypercolumn.Text = "<img border=\"0\" alt=\"View\" src=\"/Image/Edit.gif\" />";
        hypercolumn.DataNavigateUrlFields = new string[] { "Country" };
        hypercolumn.DataNavigateUrlFormatString = "~\\Default2.aspx?K=" + "{0}";

        boundcolumn = new GridBoundColumn();
        this.RadGrid1.Columns.Add(boundcolumn);
        boundcolumn.UniqueName = "CustomerID";
        boundcolumn.DataField = "CustomerID";
        boundcolumn.HeaderText = "CustomerID";
        boundcolumn.Visible = true;
        boundcolumn = null;

        boundcolumn = new GridBoundColumn();
        this.RadGrid1.Columns.Add(boundcolumn);
        boundcolumn.UniqueName = "CompanyName";
        boundcolumn.DataField = "CompanyName";
        boundcolumn.HeaderText = "CompanyName";
        boundcolumn.Visible = true;
        boundcolumn = null;

        boundcolumn = new GridBoundColumn();
        this.RadGrid1.Columns.Add(boundcolumn);
        boundcolumn.UniqueName = "ContactName";
        boundcolumn.DataField = "ContactName";
        boundcolumn.HeaderText = "ContactName";
        boundcolumn.Visible = true;
        boundcolumn = null;

        boundcolumn = new GridBoundColumn();
        this.RadGrid1.Columns.Add(boundcolumn);
        boundcolumn.UniqueName = "ContactTitle";
        boundcolumn.DataField = "ContactTitle";
        boundcolumn.HeaderText = "ContactTitle";
        boundcolumn.Visible = true;
        boundcolumn = null;

        boundcolumn = new GridBoundColumn();
        this.RadGrid1.Columns.Add(boundcolumn);
        boundcolumn.UniqueName = "Address";
        boundcolumn.DataField = "Address";
        boundcolumn.HeaderText = "Address";
        boundcolumn.Visible = true;
        boundcolumn = null;

        boundcolumn = new GridBoundColumn();
        this.RadGrid1.Columns.Add(boundcolumn);
        boundcolumn.UniqueName = "City";
        boundcolumn.DataField = "City";
        boundcolumn.HeaderText = "City";
        boundcolumn.Visible = true;
        boundcolumn = null;
    }
}
