DataGridView in Windows form

Posted by Akki_shah under C# on 10/12/2009 | Views : 3981 | Status : [Member] | Replies : 5
Hi,

I am using a ComboBoxCulumn of Data grid view. what i want is on change of ComboBox some DB oprations. like seleing a product and get its price.
i have added a ComboBox Column but the grid is showing number of rows equals to items in the ComboBox. want to display only 5 rows and if required user can add more rows in the grid. and also again when user come on the form the data should get populated from DB in all dropdown with all selected value.

if any one can send the code snipet would be helpful.




Responses

Posted by: Vuyiswamb on: 10/12/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Day Akki_shah

Very Good Question

let us see if we can solve your Problems Step by Step. I will ask questions that will enable us to give you a definite answer.

First Question

What is Displayed in that combobox ? and where do you get the Values to bind the Combobox ?

Second Question
i have added a ComboBox Column but the grid is showing number of rows equals to items in the ComboBox

Thank you for Posting at DotnetFunda

Vuyiswa Maseko


Thank you for posting at Dotnetfunda
[Administrator]

Akki_shah, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Akki_shah on: 10/12/2009 [Member] Starter

Up
0
Down
Hi

What i want is a order form. i have added a DataGridViewComboBoxColumn and populating products in DataGridView

i have some where around 50 items in product table. when i bound it to ComboBox Column grid shows 50 rows. what i want is initially it should be 5 rows and depending on requirement of user he can add more rows at run time.

again when i select the product from ComboBox it should fire selected change event so i can get its unit prise.

then user should able to fill the quentity in next column.

its the same order and order details thing.

Please help.

Akki_shah, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 10/12/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
can you please send a Screenshot , so that i can have an idea on what exactly you are doing

Thank you for posting at Dotnetfunda
[Administrator]

Akki_shah, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Akki_shah on: 10/12/2009 [Member] Starter

Up
0
Down
I dont have screen shot with me as i am surfing from office and application is there on my laptop at home.

will explain.

its a simple order form where a customer place an order and select product from list and as he selects a product system shows its price in the grid itself and he can enter the quentity he wants. at the end it gets his billing amount.

now in my case the number of products are 50 and when i bind this with Combobox the grid will show the 50 rows as i have 50 product. as i select 45th product at the first row if the grid it will shift the focus on 45th row.

i want only 5 rows in grid and if customer select 5th product the grid should add a new rwo to select 6th item. So on and so forth.

hope i am able to describe it.

Akki_shah, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 10/15/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
it is Difficult to image your problem. Sometimes i think i understand it , but when you go on explaining i get lost. Can you compile a small example Project and post it here.

Thank you for posting at dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Akki_shah, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response