T
Toby Mills
I have a placeholder control which is populated with several datagrids
at runtime. These grids all use paging, but I have to do it manually,
with buttons also added to the placeholder.
The paging works fine, except when I get to the last page, either by
using:
grdResult.CurrentPageIndex = grdResult.PageCount - 1
or:
grdResult.CurrentPageIndex += 1
On the last page, if the number of records differs from the page size
by more than one, it raises an error (see below). e.g. a page size of
10 works fine when I have 440 records (last page has 10 records), fine
for 439 records (last page has 9 records), but crashes on the last
page for 438 records (last page has 8 records)
The error message is:
An error has occurred because a control with auto-generated id
'grdResult1:_ctl10:_ctl0' could not be located to raise a postback
event. To avoid this error, explicitly set the ID property of controls
that raise postback events.
The control to which it is refering,'grdResult1:_ctl10:_ctl0', is a
checkbox, which forms part of a template in a template column in the
datagrid. The error occurs regardless of the state of the checkbox
can anybody help me with this? Can anybody even recreate this problem?
Thanks,
Toby Mills
at runtime. These grids all use paging, but I have to do it manually,
with buttons also added to the placeholder.
The paging works fine, except when I get to the last page, either by
using:
grdResult.CurrentPageIndex = grdResult.PageCount - 1
or:
grdResult.CurrentPageIndex += 1
On the last page, if the number of records differs from the page size
by more than one, it raises an error (see below). e.g. a page size of
10 works fine when I have 440 records (last page has 10 records), fine
for 439 records (last page has 9 records), but crashes on the last
page for 438 records (last page has 8 records)
The error message is:
An error has occurred because a control with auto-generated id
'grdResult1:_ctl10:_ctl0' could not be located to raise a postback
event. To avoid this error, explicitly set the ID property of controls
that raise postback events.
The control to which it is refering,'grdResult1:_ctl10:_ctl0', is a
checkbox, which forms part of a template in a template column in the
datagrid. The error occurs regardless of the state of the checkbox
can anybody help me with this? Can anybody even recreate this problem?
Thanks,
Toby Mills