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
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