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. General Programming
  3. C#
  4. Displaying the combox value

Displaying the combox value

Scheduled Pinned Locked Moved C#
help
5 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.
  • H Offline
    H Offline
    hiremath71
    wrote on last edited by
    #1

    hi, I am having a datagrid with 4 columns and one of the column type is combobox. I am adding items to that combobox column i am able to add it. now i want to display the first item in the combobox by default. Now i am selecting it ,manually help me pls With Regards prasad:)

    H 1 Reply Last reply
    0
    • H hiremath71

      hi, I am having a datagrid with 4 columns and one of the column type is combobox. I am adding items to that combobox column i am able to add it. now i want to display the first item in the combobox by default. Now i am selecting it ,manually help me pls With Regards prasad:)

      H Offline
      H Offline
      Harini N K
      wrote on last edited by
      #2

      Hi Set comboObject.SelectedIndex = 0; 0 -> if first item in the list to be displayed by default 1 -> second item ....

      Harini

      H 1 Reply Last reply
      0
      • H Harini N K

        Hi Set comboObject.SelectedIndex = 0; 0 -> if first item in the list to be displayed by default 1 -> second item ....

        Harini

        H Offline
        H Offline
        hiremath71
        wrote on last edited by
        #3

        hi,harini I am getting in normal combobox property like selectedindex. But i am using a datagridview in that one my colummn is made as combobox help me

        H 1 Reply Last reply
        0
        • H hiremath71

          hi,harini I am getting in normal combobox property like selectedindex. But i am using a datagridview in that one my colummn is made as combobox help me

          H Offline
          H Offline
          Harini N K
          wrote on last edited by
          #4

          Hi Post your code where you have added values in combo list. Are you adding values during run time or using code behind file? if Design time, then you can give selected=true ...

          Harini

          H 1 Reply Last reply
          0
          • H Harini N K

            Hi Post your code where you have added values in combo list. Are you adding values during run time or using code behind file? if Design time, then you can give selected=true ...

            Harini

            H Offline
            H Offline
            hiremath71
            wrote on last edited by
            #5

            hi,this is adding the all clumns but i want to add single row itself. I am getting error if i add rows saying that value doesn't match for datagridcombox column that is second column. OpenFileDialog ObjOpenFileDialog = new OpenFileDialog(); ObjOpenFileDialog.DefaultExt = "*.cs"; ObjOpenFileDialog.Filter = "CSharp Script Files |*.cs"; if (ObjOpenFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK && ObjOpenFileDialog.FileNames.Length > 0) { Column3.Items.Add(ObjOpenFileDialog.FileName); //scriptDGView.Rows.Add(true, ObjOpenFileDialog.FileName, "", ""); } ObjOpenFileDialog.Dispose(); help me pls

            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