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. C#
  4. how to override ondatabinding in case of binding data to datagrid

how to override ondatabinding in case of binding data to datagrid

Scheduled Pinned Locked Moved C#
wpfwcftutorial
2 Posts 2 Posters 0 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.
  • 3 Offline
    3 Offline
    333soori
    wrote on last edited by
    #1

    hello friends.......... can anybody give me some idea abt overriding ondatabinding method in case of binding data to datagrid. thanks in advance soori

    J 1 Reply Last reply
    0
    • 3 333soori

      hello friends.......... can anybody give me some idea abt overriding ondatabinding method in case of binding data to datagrid. thanks in advance soori

      J Offline
      J Offline
      Jasmine2501
      wrote on last edited by
      #2

      Do you really want to override it, or just create a new event handler? The Design View can be used to add an event handler to a control, or you can do it like this: myDataGrid.OnDataBinding += new System.EventHandler(this.myEventHandler); The OnDataBinding method itself doesn't really do anything but call the event handlers that are defined to respond to that event, and handles some issues that arise when databinding occurs (which happens when you call the DataBind() method). Did you want to change that behavior? If you override it, you will have to explicitly call the base class function in your override, or you will lose the default behaviors that keep the DataGrid functioning properly when new data is bound to it. Since you are aware of the times that you call DataBind(), you can handle any extra processing at that point, or you can create an event handler that does your extra stuff. I don't think you ever need to override the events themselves.

      "Quality Software since 1983!"
      http://www.smoothjazzy.com/ - see the "Programming" section for (freeware) JazzySiteMaps, a simple application to generate .Net and Google-style sitemaps!

      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