I have been playing with ListView and DataPager a lot lately. One reason is I have read a quite lot on these controls and thought very high of it. The combination gives us a light weight data control with Pagination facility. What more can you ask for, right?
To a vanilla page (with no gimmicks), these controls behave very nice. But once, you start your circus, they don't bend.
The magic of pagination lies in PageDataPropertiesChange() event of the ListView control. This is the event where you set the next page number properties to retrieve the next set of data. Whenever you click on a page number (which is rendered by the DataPager control), the PageDataPropertiesChange() event gets triggered.
One scenario I had was with a ListView control, the controls of which I wanted to change dynamically, particularly on ItemDataBound event. But, every time any control changes in ListView Item, the PageDataPropertiesChange() gets hit! So, pagination happens even before I hit the page numbers in the DataPager control. And that was my problem, and which it took some time to figure it out. Particularly after a heavy dose of Indian Bread and Tuna curry! :)
So there was no way out. I needed the dynamic behaviour of ListView and the pagination wouldn't budge.
After lot of googling around, I had to succumb. I split up the pages, which I am not still happy about.
The one thing I don't understand, why would a ListView event get hit when the DataPager control is shaken?
If you know of any tricks, please pass me on.
Subscribe to:
Post Comments (Atom)
Cookies, anyone?
Our application started having integration issues early March this year. Did I say that was intermittent? To add to our confusion, we coul...
-
Disclaimer: This post has nothing to do with washing or repairing cars. Well, I have been pondering over Managers and Management for lo...
-
I am a Hindu. But I did not know what it exactly meant till recently. More of the awareness came from the Satsangs (spiritual group discussi...
-
One of my colleagues came to me with a problem: He wanted to make the click event of button in his form to be activated when anyone pressed ...
No comments:
Post a Comment