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 Web Control

Custom Web Control

Scheduled Pinned Locked Moved ASP.NET
algorithmstutorialquestion
3 Posts 3 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.
  • S Offline
    S Offline
    SilentSeraph
    wrote on last edited by
    #1

    Hey everyone. I'm rather new here, so if I make any mistakes or violate etiquette, then I'd like to apologize in advance. My question is rather simple, but it seems the answer isn't, and it's difficult to phrase the question at all without an example. I've been google searching for the past two hours, and since I saw that most of the articles came from here, I figured I'd swing this one by everyone here. Basically, I would like to have items in my webcontrol, much like a datagrid does. For example... Thanks in advance for your patience and time

    D A 2 Replies Last reply
    0
    • S SilentSeraph

      Hey everyone. I'm rather new here, so if I make any mistakes or violate etiquette, then I'd like to apologize in advance. My question is rather simple, but it seems the answer isn't, and it's difficult to phrase the question at all without an example. I've been google searching for the past two hours, and since I saw that most of the articles came from here, I figured I'd swing this one by everyone here. Basically, I would like to have items in my webcontrol, much like a datagrid does. For example... Thanks in advance for your patience and time

      D Offline
      D Offline
      DavidNohejl
      wrote on last edited by
      #2

      SilentSeraph wrote: Basically, I would like to have items in my webcontrol, much like a datagrid does. For example... Like this?[^] David Never forget: "Stay kul and happy" (I.A.)
      David's thoughts / dnhsoftware.org / MyHTMLTidy

      1 Reply Last reply
      0
      • S SilentSeraph

        Hey everyone. I'm rather new here, so if I make any mistakes or violate etiquette, then I'd like to apologize in advance. My question is rather simple, but it seems the answer isn't, and it's difficult to phrase the question at all without an example. I've been google searching for the past two hours, and since I saw that most of the articles came from here, I figured I'd swing this one by everyone here. Basically, I would like to have items in my webcontrol, much like a datagrid does. For example... Thanks in advance for your patience and time

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        you can create a custom list of objects by creating a new class... public class MyCustomControlItems : object { private string myVar1=""; public MyCustomControlItems() { } public string MyVar1 { get { return myVar1; } set { myVar1=value; } } } you can add ad many specific attributes you would like to have for each item like I did with MyVar1. then in your custom control you can put an array of MyCustomControlItems like this: public class MyCustomControl : System.Web.UI.CustomControl (or w/e it is...) { private string html=""; public void RenderHtml(HtmlThingyMagig output) { output.write(html); } public MyCustomControlItems[] Items { get {bla..bla..bla... } set {bla..bla..bla... } } } i was too lazy to look up the exact namespaces for some of that stuff but thats the basic jist of it

        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