Double pager and other behaviors

T

Tumurbaatar S.

Spent 2..3 days imagining how the DataGrid works.
And found that:
1. Even the Pager position is not set to TopAndBottom, ItemCreated event
raised twice for the Pager item. So if you're using only Top or Bottom
pager,
don't forget this behavior.
2. ItemCreated is called 2 times during postback processing for every
item/row
within the DataGrid. 1st time - before Load and 2nd time - after it.
I add some controls to the Pager during ItemCreated raised before Load and
found that
these controls vanished away after Load. So I have to recreate them on
ItemCreated
called after Load.
I don't understand where they're going away after creating 1st time?
3. On 1st ItemCreated event I adjust some visual styles of the Footer
(removing some cells, changing ColSpan and etc). And (may be it follows from
2),
after Load and on 2nd ItemCreated event these changes are lost. I have to
modify them
again.
4. From 1 and 2, it follows that ItemCreated for Pager are called 4 times.
5. ItemDataBound does not raise for Pager item.
6. I've 2 DropDownList on my page. One is in the Footer and another outside
of the DataGrid.
I fill the Footer's list during ItemDataBound event and the external list -
from PageLoad with
checking of IsPostBack. So the external list is data bounded only 1 time and
it persists
its items during round trips. But the Footer's list loses its items and I
have to re-fill it
on every ItemDataBound.
EnableViewState is true for the DataGrid and anybody can explain why items
get lost?
7. Do I need to data bind above Footer list on ItemCreated or on
ItemDataBound?
If on ItemCreated, then before Load or after or on both cases?

Anything wrong in above reasoning? Something to add more or change?
 

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,770
Messages
2,569,586
Members
45,085
Latest member
cryptooseoagencies

Latest Threads

Top