Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Forms
  4. How to Raise event before and after loading data to datagridview when virtual mode on

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

Scheduled Pinned Locked Moved Windows Forms
tutorialcsscomhelpworkspace
2 Posts 2 Posters 11 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tridip Bhattacharjee
    wrote on last edited by
    #1

    My datagridview virtual mode is turned on.so i have to populate grid this way private void 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 public void BeginDataLoad(object sender, EventArgs e) { //Do something here } public void EndDataLoad(object sender, EventArgs e) { //Do something here } looking for help with code sample. thanks

    tbhattacharjee

    L 1 Reply Last reply
    0
    • T Tridip Bhattacharjee

      My datagridview virtual mode is turned on.so i have to populate grid this way private void 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 public void BeginDataLoad(object sender, EventArgs e) { //Do something here } public void EndDataLoad(object sender, EventArgs e) { //Do something here } looking for help with code sample. thanks

      tbhattacharjee

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Your loaddata-event is when the memorycache is being built. The enddata when it is done.

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups