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. Web Development
  3. ASP.NET
  4. Custom Control Help...

Custom Control Help...

Scheduled Pinned Locked Moved ASP.NET
helpdesign
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.
  • F Offline
    F Offline
    fadee
    wrote on last edited by
    #1

    Hi... I am developing a control... a custom drop down list... just give it DataSet and it will do all by itself. I want to catch its SelectedIndexChanged event... its not working... PLEASE HELP ME... me StucK and stucK badly :S public class My : System.Web.UI.WebControls.WebControl { private DropDownList ls; public My() { ls = new DropDownList(); ls.AutoPostBack = true; ls.EnableViewState = true; } public void BindControl(DataSet ds) { ls.DataSource = ds; ls.DataValueField = "ID"; ls.DataTextField = "Title"; ls.DataBind(); } private void _ApplyFilter(object sender, System.EventArgs e) { **// ITS NOT COMING HERE WHENEVER POST BACK OCCURS :((** } protected override void CreateChildControls() { Controls.Add(ls); } } --------------------- A gasp of breath, A sudden death: The tale begun. A rustled page Passes an age: The tale is done.

    S 1 Reply Last reply
    0
    • F fadee

      Hi... I am developing a control... a custom drop down list... just give it DataSet and it will do all by itself. I want to catch its SelectedIndexChanged event... its not working... PLEASE HELP ME... me StucK and stucK badly :S public class My : System.Web.UI.WebControls.WebControl { private DropDownList ls; public My() { ls = new DropDownList(); ls.AutoPostBack = true; ls.EnableViewState = true; } public void BindControl(DataSet ds) { ls.DataSource = ds; ls.DataValueField = "ID"; ls.DataTextField = "Title"; ls.DataBind(); } private void _ApplyFilter(object sender, System.EventArgs e) { **// ITS NOT COMING HERE WHENEVER POST BACK OCCURS :((** } protected override void CreateChildControls() { Controls.Add(ls); } } --------------------- A gasp of breath, A sudden death: The tale begun. A rustled page Passes an age: The tale is done.

      S Offline
      S Offline
      Simon_uk
      wrote on last edited by
      #2

      Can you not descend directly from DropDownList instead of WebControl?? If not, then look up the help on the OnBubbleEvent method and override yet in your class. HTH, Simon.

      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