GridView PageIndexChanging Not Working
This seems to be an easy question to ask, but I am not able to show items in GridView. Here is my code:

     public partial class TestList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
            if (!Page.IsPostBack)
            {   TestProject.DataAccess.Repository.Instance.Initialize(Settings.Default.TestConnection);
                BindData();
            }

        }

        private void BindData()
        {
            //Restriction Info!!
            gvAgentList.DataSource = EntityRegistration.DataAccess.Repository.Instance.GetData();
            gvAgentList.DataBind();
        }

       protected void gvAgentList_PageIndexChanging (object sender, GridViewPageEventArgs e)
        {
           
            gvAgentList.PageIndex = e.NewPageIndex;
            gvAgentList.DataBind();
        }

       private string ConvertSortDirectionToSql(SortDirection sortDirection)
       {
           string newSortDirection = String.Empty;

           switch (sortDirection)
           {
               case SortDirection.Ascending:
                   newSortDirection = "ASC";
                   break;

               case SortDirection.Descending:
                   newSortDirection = "DESC";
                   break;
           }

           return newSortDirection;
       }

       protected void gvAgentList_Sorting(object sender, GridViewSortEventArgs e)
       {
           DataTable dataTable = gvAgentList.DataSource as DataTable;

           if (dataTable != null)
           {
               DataView dataView = new DataView(dataTable);
               dataView.Sort = e.SortExpression + " " + ConvertSortDirectionToSql(e.SortDirection);

               gvAgentList.DataSource = dataView;
               gvAgentList.DataBind();
           }
       }

    }

The problem is that my GridView is not throwing me any exception and through breakpoints I can see that the function is called in code behind. 

> My sorting is also not working :(
GridView PageIndexChanging Not Working
===

This seems to be an easy question to ask, but I am not able to show items in GridView. Here is my code:

     public partial class TestList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
            if (!Page.IsPostBack)
            {   TestProject.DataAccess.Repository.Instance.Initialize(Settings.Default.TestConnection);
                BindData();
            }

        }

        private void BindData()
        {
            //Restriction Info!!
            gvAgentList.DataSource = EntityRegistration.DataAccess.Repository.Instance.GetData();
            gvAgentList.DataBind();
        }

       protected void gvAgentList_PageIndexChanging (object sender, GridViewPageEventArgs e)
        {
           
            gvAgentList.PageIndex = e.NewPageIndex;
            gvAgentList.DataBind();
        }

       private string ConvertSortDirectionToSql(SortDirection sortDirection)
       {
           string newSortDirection = String.Empty;

           switch (sortDirection)
           {
               case SortDirection.Ascending:
                   newSortDirection = "ASC";
                   break;

               case SortDirection.Descending:
                   newSortDirection = "DESC";
                   break;
           }

           return newSortDirection;
       }

       protected void gvAgentList_Sorting(object sender, GridViewSortEventArgs e)
       {
           DataTable dataTable = gvAgentList.DataSource as DataTable;

           if (dataTable != null)
           {
               DataView dataView = new DataView(dataTable);
               dataView.Sort = e.SortExpression + " " + ConvertSortDirectionToSql(e.SortDirection);

               gvAgentList.DataSource = dataView;
               gvAgentList.DataBind();
           }
       }

    }

The problem is that my GridView is not throwing me any exception and through breakpoints I can see that the function is called in code behind. 

> My sorting is also not working :(