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. combobox ok and browse button

combobox ok and browse button

Scheduled Pinned Locked Moved C#
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 want a combo with the ok and browse button .. browse i should browse the files and i can say ok pls help me with regards prasad:)

    K 1 Reply Last reply
    0
    • H hiremath71

      hi, i want a combo with the ok and browse button .. browse i should browse the files and i can say ok pls help me with regards prasad:)

      K Offline
      K Offline
      Keshav V Kamat 0
      wrote on last edited by
      #2

      during the form load event, say ComboBox1.Items.Add("Ok"); ComboBox1.Items.Add("Browse"); Then use the following code if(ComboBox1.Text=="Browse") { // use the open file dialog, to browse and choose the file. OpenFileDialog ofn = new OpenFileDialog(); ofn.Filter = "XML Files (*.xml)|*.xml"; // choose the type of the files. ofn.Title = "Type File"; if (ofn.ShowDialog() == DialogResult.Cancel) goto Quit; } i hope this helps/

      Keshav Kamat :) India

      H 1 Reply Last reply
      0
      • K Keshav V Kamat 0

        during the form load event, say ComboBox1.Items.Add("Ok"); ComboBox1.Items.Add("Browse"); Then use the following code if(ComboBox1.Text=="Browse") { // use the open file dialog, to browse and choose the file. OpenFileDialog ofn = new OpenFileDialog(); ofn.Filter = "XML Files (*.xml)|*.xml"; // choose the type of the files. ofn.Title = "Type File"; if (ofn.ShowDialog() == DialogResult.Cancel) goto Quit; } i hope this helps/

        Keshav Kamat :) India

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

        hi,keshav u r adding a text wright and it is not working.. i think my question was not clear i am having a datagrid and one of the column is made as a column type=DataGridViewComboBoxColumn and i am adding a rows like Scenario_Designer_gridview.Rows.Add(filename); where filename contains the list of files in a specifeid folder i am getting from folder browser. now i want add the list of files to a that column... i am getting error...... help me pls.

        K 2 Replies Last reply
        0
        • H hiremath71

          hi,keshav u r adding a text wright and it is not working.. i think my question was not clear i am having a datagrid and one of the column is made as a column type=DataGridViewComboBoxColumn and i am adding a rows like Scenario_Designer_gridview.Rows.Add(filename); where filename contains the list of files in a specifeid folder i am getting from folder browser. now i want add the list of files to a that column... i am getting error...... help me pls.

          K Offline
          K Offline
          Keshav V Kamat 0
          wrote on last edited by
          #4

          u mean to say that when the user clicks on the browse button, it should open a file dialog for only a fixed path, and automatically select all the files from that path, and load the names of the files in the data grid rows! right? I will try to figure it out. It requires a little addition of code. I will try it and let u know.

          Keshav Kamat :) India

          1 Reply Last reply
          0
          • H hiremath71

            hi,keshav u r adding a text wright and it is not working.. i think my question was not clear i am having a datagrid and one of the column is made as a column type=DataGridViewComboBoxColumn and i am adding a rows like Scenario_Designer_gridview.Rows.Add(filename); where filename contains the list of files in a specifeid folder i am getting from folder browser. now i want add the list of files to a that column... i am getting error...... help me pls.

            K Offline
            K Offline
            Keshav V Kamat 0
            wrote on last edited by
            #5

            or do u mean that every row in that datagrid will have a column that comprises of a combo box that allows u to choose a particular file?

            Keshav Kamat :) India

            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