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. Data binding question

Data binding question

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

    Hi I have a question related to data binding. I have a dropdown list defined like this: Ontario Manitoba British Columbia Quebec The SqldataSource object has a query “Select …, ProvinceId,…..” I would like to show all the time the proper Province selected when the page is loaded. It is possible to do an auto binding for this? Thanks, Florian Szoke

    E P 2 Replies Last reply
    0
    • F FlorianS

      Hi I have a question related to data binding. I have a dropdown list defined like this: Ontario Manitoba British Columbia Quebec The SqldataSource object has a query “Select …, ProvinceId,…..” I would like to show all the time the proper Province selected when the page is loaded. It is possible to do an auto binding for this? Thanks, Florian Szoke

      E Offline
      E Offline
      enjoycrack
      wrote on last edited by
      #2

      Hi there, Not got ur clue yet. But I think you mean that you want to do binding when the Province drop down list selection is changed, right? if so, you can set auto post back attribute of this control is true << >>

      F 1 Reply Last reply
      0
      • F FlorianS

        Hi I have a question related to data binding. I have a dropdown list defined like this: Ontario Manitoba British Columbia Quebec The SqldataSource object has a query “Select …, ProvinceId,…..” I would like to show all the time the proper Province selected when the page is loaded. It is possible to do an auto binding for this? Thanks, Florian Szoke

        P Offline
        P Offline
        Prasad Babu A
        wrote on last edited by
        #3

        Hi, You need to populate Province DropDownList at Page_Load event. Bye Pessi

        F 1 Reply Last reply
        0
        • P Prasad Babu A

          Hi, You need to populate Province DropDownList at Page_Load event. Bye Pessi

          F Offline
          F Offline
          FlorianS
          wrote on last edited by
          #4

          The DropDownList is populated in the definition. When the page is loaded I want to be selected the proper province in the dropdown list. For example if in the database the the row that I am fetching has providerid = 2 , the drop down list should show "Manitoba" I forget to mention , the SqlDataSource will have just one record to fetch.

          1 Reply Last reply
          0
          • E enjoycrack

            Hi there, Not got ur clue yet. But I think you mean that you want to do binding when the Province drop down list selection is changed, right? if so, you can set auto post back attribute of this control is true << >>

            F Offline
            F Offline
            FlorianS
            wrote on last edited by
            #5

            I found out how to do it, and it is very simple: :) In the declaration of DropDownList we have to declare : SelectedValue='<%# Bind("ProvinceId")'

            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