Hello,
I am currently working on a RadGrid that has several dynamic columns, but I'm having some trouble with the paging. Paging seems to work fine, except when you attempt to navigate back to the first page. When you navigate back to the first page, the grid still shows the data of the last page you were on.
I have added a sample project and a screenshot of the problem that can be used to reproduce the problem. Follow these steps to reproduce the problem:
1. Navigate to page 3
2. Navigate to page 1
The grid now shows both pages as selected and is still showing the data of page 3.
I am currently working on a RadGrid that has several dynamic columns, but I'm having some trouble with the paging. Paging seems to work fine, except when you attempt to navigate back to the first page. When you navigate back to the first page, the grid still shows the data of the last page you were on.
I have added a sample project and a screenshot of the problem that can be used to reproduce the problem. Follow these steps to reproduce the problem:
1. Navigate to page 3
2. Navigate to page 1
The grid now shows both pages as selected and is still showing the data of page 3.
public
partial
class
Index : Page
protected
void
Page_Init(
object
sender, EventArgs e) {
this
.CreateGrid();
}
private
void
CreateGrid() {
RadGrid grid =
new
RadGrid();
grid.ID =
"gvBenchmark"
;
grid.AutoGenerateColumns =
false
;
grid.Skin =
"Metro"
;
grid.AllowSorting =
true
;
grid.AllowPaging =
true
;
grid.PageSize = 15;
grid.SortingSettings.SortToolTip = String.Empty;
GridBoundColumn idColumn =
new
GridBoundColumn();
idColumn.HeaderText =
"ID"
;
idColumn.UniqueName =
"ID"
;
idColumn.DataField =
"ID"
;
grid.Columns.Add(idColumn);
GridBoundColumn ageColumn =
new
GridBoundColumn();
ageColumn.HeaderText =
"Age"
;
ageColumn.UniqueName =
"Age"
;
ageColumn.DataField =
"Age"
;
grid.Columns.Add(ageColumn);
grid.DataSource =
this
.GetData();
grid.DataBind();
pnGrid.Controls.Add(grid);
}
private
IList<Person> GetData() {
IList<Person> persons =
new
List<Person>();
for
(
int
i = 0; i < 100; i++) {
Person p =
new
Person();
p.Age = i + 10;
p.ID = i;
persons.Add(p);
}
return
persons;
}
}
public
class
Person {
public
int
Age {
get
;
set
; }
public
int
ID {
get
;
set
; }
}