Dropdown List in a DataGrid

J

John Doe

Hi everyone,

I want to display one of the fields in My datagrid as a dropdownlist box....

I have created a DataSet that contains 2 tables, one parent and one child, I
have also created a Relationship between these tables in my dataset.

I am using a Column Template to diplay the data for the field I wish to be
displayed in the dropdownlist, but i have not been able to map the data from
my lookup table into the list, when I run the application all I get is an
empty dropdownlist !?!?

I have attempted to set the DataMember, DataTextField & DataValueField
attributes of my Control, but all to no avail!

Can anyone give me a few pointers as to what I am doing wrong ?


Test Data

Dim oMytable As New DataTable("Main")

oMytable.Columns.Add(New DataColumn("NO"))

oMytable.Columns.Add(New DataColumn("DATE"))

oMytable.Columns.Add(New DataColumn("TYPE"))

....... next is the code that populates the main table

oDataSet.Tables.Add(oMytable)

oMytable = New DataTable("Lookup")

oMytable.Columns.Add(New DataColumn("TYPE"))

oMytable.Columns.Add(New DataColumn("ESCRIP"))

....... next is the code that populates the lookup table

oDataSet.Tables.Add(oMytable)

oDataSet.Relations.Add("AccLink", oDataSet.Tables("Lookup").Columns("TYPE"),
oDataSet.Tables("Main").Columns("TYPE"))

This DataSet is then Bound to my DataGrid
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top