B
Ben
Hi,
I have come across a situation which appears to be a BUG
with the DataGrid control (asp:datagrid)
Following the application of a fliter on a PostBack, it
seems the total number of items (dgItems.Items.Count) of
the control varies depending on its page size ?
What prompted me to look this in more depth is that 2
pages show at the bottom of the grid and when the user
clicked on the '2' to get to the second page, nothing
happens.
I initially had a data grid with a page size of 8 and a
filter which filters the datagrid down to 8 items.
Theoretically, if there are 8 items (rows) and a page
size of 8, the page should not display pages...? First
problem.
If I change the page size to 9, the number of items now
displayed by the datagrid is 9 and the page does not
display anymore page BUT there now 9 items displayed...?!
How can the page size affect affect the result of a
filter ?!
I actually ran this in 'debug mode' with a break point in
my code and witnessed the number of items (Items.Count)
change before my eyes in the watch window as I changed
the page size value.
Here is a sample of code :
(...)
With oDV
.Sort = strSortField & strSortOrder
.RowFilter = mstrFilter
End With
With dgItems
.PageSize = 8
.PagerStyle.Mode = PagerMode.NumericPages
.DataSource = oDV ' A DataView object
.DataBind()
End With
(...)
Any ideas ?
Thank you,
Ben
I have come across a situation which appears to be a BUG
with the DataGrid control (asp:datagrid)
Following the application of a fliter on a PostBack, it
seems the total number of items (dgItems.Items.Count) of
the control varies depending on its page size ?
What prompted me to look this in more depth is that 2
pages show at the bottom of the grid and when the user
clicked on the '2' to get to the second page, nothing
happens.
I initially had a data grid with a page size of 8 and a
filter which filters the datagrid down to 8 items.
Theoretically, if there are 8 items (rows) and a page
size of 8, the page should not display pages...? First
problem.
If I change the page size to 9, the number of items now
displayed by the datagrid is 9 and the page does not
display anymore page BUT there now 9 items displayed...?!
How can the page size affect affect the result of a
filter ?!
I actually ran this in 'debug mode' with a break point in
my code and witnessed the number of items (Items.Count)
change before my eyes in the watch window as I changed
the page size value.
Here is a sample of code :
(...)
With oDV
.Sort = strSortField & strSortOrder
.RowFilter = mstrFilter
End With
With dgItems
.PageSize = 8
.PagerStyle.Mode = PagerMode.NumericPages
.DataSource = oDV ' A DataView object
.DataBind()
End With
(...)
Any ideas ?
Thank you,
Ben