Click here to Skip to main content
15,790,917 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

I need to fill datagridview combobox column(Package) by stores procedure. The parameter value for the SP will be taken from previous column (Product).

once the product column is selected then the packing should be loaded as per the stores procedure and once packing has selected "unitbuy" has to be shown as rate.

I have created datagirdview combo box column
Dim Combopkg As New DataGridViewComboBoxColumn
      With Combopkg
          .HeaderText = "Package"
          .DataPropertyName = "PackID"
          .DisplayMember = "PKG"
          .ValueMember = "ID"
          .Name = "PackID"
          .Width = 75
      End With

I dont know how to give datasource..

my stores procedure, which i already created in sql as follows,
Create proc [dbo].[spPkgBuy]

@PDT int

select ID,PKG,UnitBuy from vpkg where PDTID=@PDT


So if the value of DGV cells("Product") has changed then stores procedure should work for next colum. Packing of particular product id will be loaded. The stores procedure is designed like that. Once package has selected then unitbuy value from store procedure should filled in DGV.cells("Rate") but it should not be read only. After filling rate column also, i can edit it.

I have posted same question in msdn [^]but no reply has got..

Please help me..

Updated 17-Sep-15 1:26am

1 solution

i think this Link[^] will help you
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900