protected void gvDataBind() { DataTable dt = ToolInfo.ToolList(); 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); } }