|
-
Jul 15th, 2009, 10:12 PM
#1
Thread Starter
Junior Member
[RESOLVED] datagridview Combo filling
I have a dataGridView in my program that displays stuff .

The invoice No column has a combo box
what I wanna do is when the form loads the All the invoice No's which r in the DB should be loaded into the combo box
When I select the Invoice No using the combo box the rest should fill
this is what I did --
In form load wrote a code to fill the combo it din work
I tried but the combo box didnt fill
And the combo box dropdown also didnt work
In normal combo I use
Code:
ComboBox1_SelectionChangeCommitted
but in the datagrid combo what should I use ?
If can please help me ?
--
thx
nVidia
I am a newbee for .net
-
Jul 15th, 2009, 10:25 PM
#2
Fanatic Member
Re: datagridview Combo filling
You want to fill a field data to combobox ???
-
Jul 15th, 2009, 10:54 PM
#3
Thread Starter
Junior Member
Re: datagridview Combo filling
thx 4 replying
I wanna fill the combobox which is inside the datagridview
-
Jul 16th, 2009, 01:00 AM
#4
Re: datagridview Combo filling
That doesn't really make sense. If that was a standard ComboBox and a bunch of TextBoxes then I could understand it. You'd use the ComboBox to select the record and then edit the fields in the TextBoxes. In a DataGridView it doesn't really make sense to populate the row based on the combo box selection though. In a grid you should be displaying all the records together at the same time. The combo box should be used for editing the field in that column by setting it to one of a finite list of values. I think you need to rethink your design.
-
Jul 16th, 2009, 01:12 AM
#5
Thread Starter
Junior Member
Re: datagridview Combo filling
- my purpose isnt editing purpose is adding
- A list of invoice No's already there in the db
- Now what wanna do is I Click the Add button in my form then
- A new row will appear like shown in the image (first post image)
- now once I select the invoice No from the datagridcombo box the other fields will be filled and a reocrd will be inserted to another table
- Next If I wanna insert another record agan I will click the datagridcombo box and select the invoice no now again the fields will be filled and a reocrd will be inserted to another table like this I wanna DO
The problems I face
1. the combo box isnt getting filled IF i use this method

2. And I dont know the correct method to detect the datagrid combobox value changed
Last edited by nVidia; Jul 16th, 2009 at 01:17 AM.
-
Jul 16th, 2009, 01:20 AM
#6
Re: datagridview Combo filling
Your UI still doesn't make sense. The ComboBox shouldn't be in the grid. When you click the Add button the user should be presented with a list of invoices to choose from, probably in a dialogue, maybe in a grid or maybe in a set of controls with a single ComboBox and multiple TextBoxes or Labels. Once the user makes a selection, the data from the selected row should be added to the grid, which will contain all text box columns.
-
Jul 16th, 2009, 01:25 AM
#7
Thread Starter
Junior Member
Re: datagridview Combo filling
presented with a list of invoices to choose from, probably in a dialogue
this idea is ok then How to pass a object between two MDI child forms ! ?
-
Jul 16th, 2009, 02:13 AM
#8
Re: datagridview Combo filling
 Originally Posted by nVidia
this idea is ok  then How to pass a object between two MDI child forms ! ?
It wouldn't be two MDI child forms. The user should be making a selection from a modal dialogue. You would call ShowDialog and once it returns you can get property values and/or call methods of the dialogue to get the data you need.
-
Jul 16th, 2009, 04:00 AM
#9
Thread Starter
Junior Member
Re: datagridview Combo filling
It works but I used a module pass data between forms
thx !!!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|