Click here to Skip to main content
15,351,641 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using Parent Datagridview,Child Gridview,SubChild Gridview in my form.
This datas are getting records from Different Tables.
If the records inthe table, It must view the datas. But if the table has no values
may typing the datagridview. But my problem is whenever the user typing the datas the dropdownlist will appear, they can selecting it which is retrieve by database table. Is it Possible? Please help me..

And then I have set Identity Column in ID field of the Child Table, Can we set AutoIncreament on the datagridview at runtime?

My code for binding datasource is


VB
masterda = New SqlDataAdapter("Select * from tbl_ProductMaster where ProductType='OTHER ITEMS'", Cn)


           data.Locale = System.Globalization.CultureInfo.InvariantCulture
           masterda.Fill(data, "Customers")

           detailsda = New SqlDataAdapter("Select MENUID,MENUNAME,MENUQTY,UOM,ID from MenuContains", Cn)
           detailsda.Fill(data, "Orders")

           detailsda1 = New SqlDataAdapter("Select * from ReceipeContains", Cn)
           detailsda1.Fill(data, "Receipes")

           Dim relation As New DataRelation("CustomerOrder", data.Tables("Customers").Columns("ID"), data.Tables("Orders").Columns("MenuID"))
           data.Relations.Add(relation)

           Dim relation1 As New DataRelation("OrderReceipes", data.Tables("Orders").Columns("ID"), data.Tables("Receipes").Columns("Raw_ID"))
           data.Relations.Add(relation1)

           masterbindingsource.DataSource = data
           masterbindingsource.DataMember = "Customers"

           detailsbindingsource.DataSource = masterbindingsource
           detailsbindingsource.DataMember = "CustomerOrder"

           detailsbindingsource1.DataSource = detailsbindingsource
           detailsbindingsource1.DataMember = "OrderReceipes"
Posted
Updated 5-Sep-12 23:51pm
v2

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