Multiple choice technology programming languages

Suppose you are implementing paging to your datagrid named grdtest using following code: protected void grdtest_PageChanger(object Source, DataGridPageChangedEventArgs E) { DataTable dttable = new DataTable(); //populate dttable with appropriate data from database grdtest.DataSource = dttable; grdtest.DataBind(); } what is the main thing missing in above code:

  1. grdtest.AllowCustomPaging = true;

  2. grdtest.AllowPaging = true;

  3. grdtest.CurrentPageIndex = E.NewPageIndex;

  4. Both i and ii

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The PageIndexChange event handler receives the new page index through E.NewPageIndex but never assigns it to grdtest.CurrentPageIndex. Without this critical assignment, the DataGrid cannot update its display position after rebinding - it will remain stuck on whatever page it was on before. The DataSource and DataBind calls only refresh the data, not the page position.