예제 #1
0
    private void _Bind()
    {
        try
        {
            if (grd_QuizList.DataSourceID.Length >= 1)
            {
                grd_QuizList.DataSourceID.Remove(0, grd_QuizList.DataSourceID.Length);
            }

            dt = objAdmin.GetAllDetailsQuiz();


            grd_QuizList.DataSourceID = "";

            if (dt == null || dt.Rows.Count == 0)
            {
                dt = _CreateEmptyTable();
            }

            DataView dv = dt.DefaultView;
            if (this.ViewState["SortExp"] == null)
            {
                //this.ViewState["SortExp"] = "make";
                //this.ViewState["SortOrder"] = "ASC";
            }
            else
            {
                dv.Sort = this.ViewState["SortExp"] + " " + this.ViewState["SortOrder"];
            }

            grd_QuizList.DataSource = dv;
            grd_QuizList.DataBind();
        }
        catch (Exception ex)
        {
            Helper.Log(ex.Message, "AddQuizTest/_Bind()");
        }
    }