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. how to enter dataset value into the combobox as Selected Text

how to enter dataset value into the combobox as Selected Text

Scheduled Pinned Locked Moved ASP.NET
csharphelptutorialannouncement
4 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.
  • A Offline
    A Offline
    Amit Spadez
    wrote on last edited by
    #1

    Hello all, I'm working on some Desktop based Project in VB.Net in which I have made a page (say UpdateData.aspx) to update the employeeDetails.In that page, There is a DataGridView that displays all the detials. So, I'm using the cell_click event of the gridview. So, When I click on the gridview row, it retrieves all the records which are then populated into respective fields, except into 3 combobox fields. I don't know what to do with them to enter some particular value into those comboboxes as those also contain some datasource. And My code is like the following: ds = obj.GetDetails(objBo) If ds.Tables(0).Rows.Count>0 Then comboItemName.SelectedText = ds.Tables(0).Rows(0)("itemName") comboItemSerialNo.SelectedText = ds.Tables(0).Rows(0)("SerialNo") END please help... Thanks in advance

    S 1 Reply Last reply
    0
    • A Amit Spadez

      Hello all, I'm working on some Desktop based Project in VB.Net in which I have made a page (say UpdateData.aspx) to update the employeeDetails.In that page, There is a DataGridView that displays all the detials. So, I'm using the cell_click event of the gridview. So, When I click on the gridview row, it retrieves all the records which are then populated into respective fields, except into 3 combobox fields. I don't know what to do with them to enter some particular value into those comboboxes as those also contain some datasource. And My code is like the following: ds = obj.GetDetails(objBo) If ds.Tables(0).Rows.Count>0 Then comboItemName.SelectedText = ds.Tables(0).Rows(0)("itemName") comboItemSerialNo.SelectedText = ds.Tables(0).Rows(0)("SerialNo") END please help... Thanks in advance

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

      vinci007 wrote: some Desktop based Project I assume this was a typo. Provided that you have setup the data source for the comboboxes in the template (if using them), and the selected text matches the valid entries, the display should be correct. You may also need to provide the selectedvalue properties though. What is the error/problem? Shreekar

      A 1 Reply Last reply
      0
      • S shreekar

        vinci007 wrote: some Desktop based Project I assume this was a typo. Provided that you have setup the data source for the comboboxes in the template (if using them), and the selected text matches the valid entries, the display should be correct. You may also need to provide the selectedvalue properties though. What is the error/problem? Shreekar

        A Offline
        A Offline
        Amit Spadez
        wrote on last edited by
        #3

        Yeah, there are valid datasource in the combobox. The problem is that the value is not shown in the "comboItem" combobox for editing... in other words , combobox doesn't get value on edit... what could be the error...

        S 1 Reply Last reply
        0
        • A Amit Spadez

          Yeah, there are valid datasource in the combobox. The problem is that the value is not shown in the "comboItem" combobox for editing... in other words , combobox doesn't get value on edit... what could be the error...

          S Offline
          S Offline
          shreekar
          wrote on last edited by
          #4

          Please share the relevant code as the sequence of events might have some bearing on the problem. Can you see the list of values in the dropdown? Shreekar

          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