Exemplo n.º 1
0
        protected void gvDataBind()
        {
            DataTable dt = ToolInfo.getDepartGv(Session["DepartName"].ToString());

            DataView view = dt.DefaultView;
            string   sort = (string)ViewState["SortExpression"] + " " + (string)ViewState["SortDir"];

            view.Sort = sort;

            if (dt.Rows.Count == 0)
            {
                dt.Rows.Add(dt.NewRow());
                UI.BindCtrl(dt.DefaultView, gvTool, AspNetPager1);
                gvTool.Rows[0].Visible = false;
            }
            else
            {
                UI.BindCtrl(dt.DefaultView, gvTool, AspNetPager1);
            }
        }