Hello,
I'm using several WebDropDown inside a modal WebDialogWindow.
Szenario: The user can select an data object inside a grid and then choose to edit this item via the dialog. After closing the dialog the user can edit another item via the dialog and so on without reloading the web page.
Since some of the WebDropDowns have up to 5k items I like LoadOnDemand being enabled. But what I noticed is that if a WebDropDown has e. g. loaded most of its data items when executing the dialog, it will hold all the loaded items. As a result opening the dialog will be slowed down the more often I open the dialog because the WebDropDowns carry all their data items with them.
This is entirely not the intended behaviour. I would like to have the WebDropDowns initially containing the first page of data items and load the rest on demand every time I open the dialog. In other words I'd like the WebDropDowns to be "re-initialized" every time the dialog opens.
I've played around with view states but have not found a clue yet how to do that (besides reloading the whole page what I don't relly want).
I think this should be simple to achieve but I can't see how?
your solution works.
I've tried setting the current page in another context but I did not get it running. As I know now from your solution I have to call databind after setting the current page which I didn't realize.
Thanks again.
Hello bernhardus,
You could trigger an ajax request to the server manually from the client side with the loadItems function. It will trigger the server side onitemsrequested event.
During this event you can set the current page to 0 and re-databind so the items collection would be refreshed and start loading from the beginning again.
You can refer to the modified sample. Let me know if you need any further assistance with this.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support
Thanks for your efforts. I've downloaded the sample and will check it tomorrow.
But for clarity: I am not changing the data source. If the user cancels the dialog this will not be reported to the server. There is no page reload or something like that. If the user then opens the dialog again the data source of the WebDropDown remains the same. The WebDropDown should initially load the first N items (acc. to page size), just as it does when the dialog is opened for the first time after loading the web page.
But again - I'll check it.
Hello bernhardus ,
Thank you for your patience. I've received a response from our development team.
It seems that the load on demand is connected with the drop down’s paging and the current page to which the drop down should load is kept in the CurrentPage property of the web drop down.
To force the drop down to start loading from the beginning again it suffices to set the CurrentPage to 0 when you change the data source.
I’ve prepared a sample for your reference. Let me know if you have any further questions.
Thank you for posting in our forum.
I’ve managed to reproduce this issue and it seems that the loaded items are indeed saved but not in the view state.
For now I suggest you re-create the WebDropDown when you change the data source so that it would be completely cleared.
I’ve contact our development team to inquire whether there’s another way to clear this state and will let you know once I receive a response.
Let me know if you have any questions or concerns in the meantime.