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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Sorted Checkboxlist

Sorted Checkboxlist

Scheduled Pinned Locked Moved ASP.NET
tutorialquestion
3 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.
  • V Offline
    V Offline
    vjvjvjvj
    wrote on last edited by
    #1

    Hi, I have a checkboxlist which is databound in code behind. chkListBaseMaps.DataSource = oDataSet chkListBaseMaps.DataTextField = "LayerName" chkListBaseMaps.DataValueField = "Layer_ID" chkListBaseMaps.DataBind() I get the checkboxlist ordered on Layer_ID. I delete/insert items in checkboxlist and do the same with associated dataset and bind the chklistbox again. What I need is everytime I bind the checkboxlist, i need the checkboxlist to be ordered (sorted as ASC) on LayerName field which is datatextfield. How to do that? thanks vijay

    S 1 Reply Last reply
    0
    • V vjvjvjvj

      Hi, I have a checkboxlist which is databound in code behind. chkListBaseMaps.DataSource = oDataSet chkListBaseMaps.DataTextField = "LayerName" chkListBaseMaps.DataValueField = "Layer_ID" chkListBaseMaps.DataBind() I get the checkboxlist ordered on Layer_ID. I delete/insert items in checkboxlist and do the same with associated dataset and bind the chklistbox again. What I need is everytime I bind the checkboxlist, i need the checkboxlist to be ordered (sorted as ASC) on LayerName field which is datatextfield. How to do that? thanks vijay

      S Offline
      S Offline
      Sandeep Mewara
      wrote on last edited by
      #2

      Why not use DataView to associate with checkboxlist and bind it? Do all you need with dataview... sorting... filtering! Thus, this line would change: chkListBaseMaps.DataSource = oDataSet oDataView

      V 1 Reply Last reply
      0
      • S Sandeep Mewara

        Why not use DataView to associate with checkboxlist and bind it? Do all you need with dataview... sorting... filtering! Thus, this line would change: chkListBaseMaps.DataSource = oDataSet oDataView

        V Offline
        V Offline
        vjvjvjvj
        wrote on last edited by
        #3

        Yep helped it Thanks a lot vijay

        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