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