BUG : DataGrid ?!

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top