private void LoadDataGrid(bool IsResetPageIndex, bool IsSort, string strFieldName = "", string strFieldValue = "") { objSubOrder = new tblSubOrder(); objDataTable = objSubOrder.GetCofirmProductList(Convert.ToInt32(Enums.Enums_OrderStatus.Ordered)); //'Reset PageIndex of gridviews if (IsResetPageIndex) { if (dgvGridView.PageCount > 0) { dgvGridView.PageIndex = 0; } } dgvGridView.DataSource = null; dgvGridView.DataBind(); //'Check for data into datatable if (objDataTable.Rows.Count > 0) { objDataTable = SortDatatable(objDataTable, ViewState["SortColumn"].ToString(), (appFunctions.Enum_SortOrderBy)ViewState["SortOrder"], IsSort); dgvGridView.DataSource = objDataTable; dgvGridView.DataBind(); } objSubOrder = null; }