Tricking scrollbar into scrolling through unloaded items

I have a potentially huge xml data file present on a server. I would like the data to be loaded into a datagrid on a client machine to allow the user to scroll through the items in the xml file and select one. Due to the potential huge size of the data I dont really want to get the entire xmlfile and load it into the datagrid. For this reason Im trying to give the impression of all the data being loaded without actually loading it all.

Im doing this by capturing the scroll event from the scroll bar and requesting the rows currentScrollbarvalue to ( currentScrollbarvalue + number of records to display ) loading the xml into an xmldataprovider and setting this to the datasource of the datagrid. The issue I have is that my datagrid flashes grey occasionally when scrolling. Im assuming this is because it is rendering the datagrid inbetween the datasource being assigned?

Basically Im wondering if I am doing this in the correct way and if so if it would be possible to stop this flashing.

Please let me know if you need antyhing explaining in more detail or any code posting.

Answers


use the VirtualMode property. This way the grid items will be only made visible when they are made visible. You then use implement the event CellValidating to fill the list. See http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.virtualmode.aspx

For DataGrid you need to set the EnableRowVirtualization property to true. This only works with data binding.

See http://msdn.microsoft.com/en-us/library/system.windows.controls.datagrid.enablerowvirtualization.aspx


Need Your Help

AngularJS and Spring Rest

angularjs spring-mvc spring-rest

I'm using AngularJS to post a simple form to an API written with Spring boot and Rest. Every class is annotated with @RestController

Running <jdbc:initialize-database> at the beginning of context creation

java spring properties

I need to execute SQL script before PropertyPlaceholderConfigurer is initialized in Spring's context, as soon as application properties are stored in the database and this script should insert them...