Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

How to Raise event before and after loading data to datagridview when virtual mode on

$
0
0

My datagridview virtual mode is turned on.so i have to populate grid this way

privatevoid dataGridView1_CellValueNeeded(object sender,DataGridViewCellValueEventArgs e){
    e.Value= memoryCache.RetrieveElement(e.RowIndex, e.ColumnIndex);}

from these thread

http://stackoverflow.com/questions/13856869/notify-when-event-from-another-class-is-triggered
http://stackoverflow.com/questions/4378339/raise-an-event-of-a-class-from-a-different-class-in-c-sharp

i got the logic how to raise event to calling environment.

i am in confusion from where to raise event in my code. apologized that i could not submit my full code but here i am mentioning a url where i post my full working code. please have a look and guide me how to raise event from my code.

so this is the url where i post my full working code

http://stackoverflow.com/questions/31458197/
how-to-sort-datagridview-data-when-virtual-mode-enable/31475803#31475803

My Objective

i want to raise a event when data load will start and again want to raise another event after populating all rows of the grid.

my Event handler code would look like

publicvoidBeginDataLoad(object sender,EventArgs e){//Do something here}publicvoidEndDataLoad(object sender,EventArgs e){//Do something here}

looking for help with code sample. thanks


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>