I have 10000 records in my Database and i want to show them in LongListSelector. I want to load first 20 records in LongListSelector first and when user scrolls to end of LongListSelector then want to add next 20 records in LongListSelector and so on, when user reaches the end of page then more data are loaded.
any one can tell me that how to do this.
Thanks
Yes, you could simply use the LongListSelector.ItemRealized and LongListSelector.ItemunRealized events to to trigger fetching of real data into the item ViewModels.
You could refer these:
Does LongListSelector make Lazy Load for us?
Lazy Loading with LongListSelector in LayoutMode=Grid
Related
Have a question about best practise of fetching large json data from reactjs application.
Let's say we have fetch url foo.com and we also have from,to variables like 0 to 6 or whatever we put there. And we have about 10 000 elements in response json.
I need all these rows because I need to make sorting about all of them. But it takes too much time rendering them all together.
Is there any good practise.
Fetch them all and client waits (using at the moment)
Fetch n items until all fetched (better speed?)
Fetch n items, show already fetched data and fetch remaining values in background (In this case only sorting part waiting until last fetched, but client can look around already on page)
Fetching 10K items at once is not a good idea in most cases. Neither
is rendering 10K items on the screen. The trick is to find a sweet spot in UX that allows you to NOT render/fetch this many items.
You need to ask yourself what's the most important thing for user on this page.
Do they want to see the top most blah record?
Do they mostly care about seeing and eyeballing the items?
Are they searching for a particular item?
If you can't change the api do the sorting for you on the server, then here is what I would do:
load first 100 items, sort them and then render them on the scree
kick of the fetch for the next 100 item and show a loading message to user
once the second page is fully fetched, sort all 200 and before rendering indicate on the UI that "there is new data, click here to see" but still only render the top 100 ones
repeat until you have all the items but give the user the ability to cancel at any time
The benefits are:
√ user sees data as soon as first page is there
√ you always render 100 items with a "show more" button so your DOM will be lean
√ they can cancel at any time if they have found what they were looking for
I am developing a MS Access 2016 application with bound controls on Forms. Late in the process I decided I want a multi-select listbox.
From what I can see, you can't bind a multi-select listbox to a table. I'm okay with parsing the listbox when about to leave that record, and putting a comma separated list of values in a bound, non-visible text box. And then on arriving at the new record, setting the values in the listbox based on the values in that record's textbox.
The Current event lets me know when I arrive at a new record, but is there an event that lets me know I'm leaving a record? Before Update only works if the current record is changed, not just navigating to a new record. I suspect I'm missing something real basic.
If you want to parse a field and manually update it to a table, use the Before Insert and Before Update events. Don't do anything with navigation, because then you're likely too late.
Also, make sure to dirty the form when the value of the list box changes (Me.Dirty = True in the On Change event), so the update fires when navigating.
Or, like krish KM says, just make sure your text box changes every time your listbox changes.
That's more reliable than accounting for navigation, filtering, closing the form, manually saving, etc.
I want to create a dropdown list where it is list the data from database and when I press on of them, it give detail of the item. How should I do it? Here is some explanation on how I want to do it. In a dropdown list I have users from the database and when I click one of the user, it tell's me the detail of the user using ajax.
It is up to you and your case.
One option is getting the data with all the details (it will slow the initial loading depending on how big your records are).
You can, on the other hand, get simplified data and get the data by id for details on every click.
Which one is right? Totally depends.
In ms access I have a form which also has a sub-form. I wanted to programmatically change the RecordsetType in the main-form to snapshot when the sub-table/sub-form has associated records in the one-to-many relationship. I wrote some vba code to do this but I was experiencing some very odd behaviour.
I then discovered that it was because when I change the RecordsetType, the form refreshes and navigates back to the first record. That then causes the On Current event and associated code to fire in both the sub-form and main-form twice. I was thinking of using DoCmd.SearchForRecord to navigate back to the original record but quickly realized that it wouldn't work because the the WHERE condition in the DoCmd.SearchForRecord gets overridden when the events fire the second time around. It all seemed so inefficient any way.
Are there any other methods to do what I am trying to do? I don't really want to set the controls in the form to 'Disabled'.
MS Access has a selection of form properties that should suit: AllowEdits, AllowDeletions and AllowAdditions. These can be set separately or together. In this case, it seems that you need AllowAddition set to Yes and AllowEdits set to No.
SQL Server 2008
In my table I have millions of records.
Now when I try to bind all records in Gridview then It takes more time to fetch that all records.
If I want to Select only 10-10 records at a time
means in Gridview first I am on first page and it display first 10 records then when I go to next page
it display second 10 records likewise....
So how its possible? and Can I get total counts of that records in that store procedure?
You can create dynemic paging to load large data, can refer bellow links for help.
Custom Paging
Or
Custom Paging 2
In ASP.NET paging and sorting is extremely simple when hitting a SQL database for the source.
Just drop an appropriate DataSource control (like EntityDataSource if you are using Entity Framework, or LinqDataSource is you are using LinqToSQL) on the page with your gridview, and configure it (clicking the little expander icon in the designer and clicking the 'Configure Data Source' link.
Set that DataSource control's ID as your GridView's DataSourceID property value.
On the GridView set AllowPaging="true" and the PageSize="10" (can be whatever you want for number of rows per page).
You're done