DDL and DataGrid

G

Guest

Hi all. I would like to show child elements in a datagrid of the parent
element in a DDL. I have populated the DDL ok, but how do I dynamically
update the Datagrid? I am trying the folowing~:

Dim selectedItem = DropDownList1.SelectedValue
Me.Label1.Text = "" + selectedItem + ""
Me.DataGrid1.Visible = False
Me.MySqlCommand2.CommandText = "select * from filename where
Customer_id=" + selectedItem
Me.MySqlDataTable2.SelectCommand = Me.MySqlCommand2
Me.MySqlDataAdapter2.Fill(DataSet21)
DataGrid1.DataBind()
Me.DataGrid1.Visible = True
 
G

Guest

Niggy,
After populating the dataset assign it to datasource property of the grid
and bind it

DataGrid1.DataSource =DataSet21;
DataGrid1.DataBind();

This should work for you.

Thanks

IntelYogi
 

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,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top