Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["SortExpression"] == null)
            {
                Session["SortExpression"] = "ID";
                Session["SortDirection"]  = SortDirection.Ascending;
            }

            DataTable dt = bi.GetEthnicData();
            this.dlRace.DataSource     = dt;
            this.dlRace.DataTextField  = "FieldName";
            this.dlRace.DataValueField = "FieldValue";
            this.dlRace.DataBind();
            this.dlRace.SelectedIndex = 0;

            dt.Rows.RemoveAt(0);

            this.dlRaceEdit.DataSource     = dt;
            this.dlRaceEdit.DataTextField  = "FieldName";
            this.dlRaceEdit.DataValueField = "FieldValue";
            this.dlRaceEdit.DataBind();
            this.dlRaceEdit.SelectedIndex = 0;

            PopulateGrid();
            dt.Clear();
            dt.Dispose();
        }
    }