Which function trigger to load next set of data when user scroll datagridview c#
-
I am working with datagridview. My datagridview virtual mode is turned on.so i populate grid this below way
private void dataGridView1_CellValueNeeded(object sender,DataGridViewCellValueEventArgs e)
{
e.Value = memoryCache.RetrieveElement(e.RowIndex, e.ColumnIndex);
}basically i took the code from a msdn link and customize bit. one thing is not clear to me which function is getting called first when user scroll datagridview. please tell me the function name. also tell me how relation has been established between datagridview scroll and function call to load next set of data. here i am not posting my full code rather here leaving a url from where anyone can see the full working code. here is the url http://stackoverflow.com/questions/31458197/how-to-sort-datagridview-data-when-virtual-mode-enable/31475803#31475803 please have a look and help me to understand the area which is getting called when user scroll down the datagridview. thanks
tbhattacharjee
-
I am working with datagridview. My datagridview virtual mode is turned on.so i populate grid this below way
private void dataGridView1_CellValueNeeded(object sender,DataGridViewCellValueEventArgs e)
{
e.Value = memoryCache.RetrieveElement(e.RowIndex, e.ColumnIndex);
}basically i took the code from a msdn link and customize bit. one thing is not clear to me which function is getting called first when user scroll datagridview. please tell me the function name. also tell me how relation has been established between datagridview scroll and function call to load next set of data. here i am not posting my full code rather here leaving a url from where anyone can see the full working code. here is the url http://stackoverflow.com/questions/31458197/how-to-sort-datagridview-data-when-virtual-mode-enable/31475803#31475803 please have a look and help me to understand the area which is getting called when user scroll down the datagridview. thanks
tbhattacharjee
Tridip Bhattacharjee wrote:
one thing is not clear to me which function is getting called first when user scroll datagridview.
You should read more of what is one MSDN, as it explains the topic quite well. The "ValueNeeded" event is called for each cell that needs painting, regardless of what causes the paint; whether that is a scroll, or maximizing the form. If the grid needs values, that event is fired.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)