R
RSH
Hi,
i have a situation where I have an object (Company) that returns a dataset
for the Employees Property which in turn I would like to bind to a DDL.
My problem is that I want to be able to select the Employee from the DDL and
return the detail information for the selected employee
onSelectIndexChanged. I was thinking since I alredy have the information in
the Object I would like to bind the datarow to the value and onchange I
would simply extract the information and display it.
I have been struggling with the syntax:
company1 = New Company("00000001")
DropDownList1.DataSource = company1.Employees
DropDownList1.DataTextField = company1
..Employees.Tables(0).Columns(3).ColumnName 'This binds the
Employee's name
DropDownList1.DataValueField = datarow() 'This is where I would
like to bind the DataRow
DropDownList1.DataBind()
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
Label1.Text = ???? ' This is where I would like to access the
DataRows Values
End Sub
How do i go about doing this? Is it a good idea??
Thanks,
Ron
i have a situation where I have an object (Company) that returns a dataset
for the Employees Property which in turn I would like to bind to a DDL.
My problem is that I want to be able to select the Employee from the DDL and
return the detail information for the selected employee
onSelectIndexChanged. I was thinking since I alredy have the information in
the Object I would like to bind the datarow to the value and onchange I
would simply extract the information and display it.
I have been struggling with the syntax:
company1 = New Company("00000001")
DropDownList1.DataSource = company1.Employees
DropDownList1.DataTextField = company1
..Employees.Tables(0).Columns(3).ColumnName 'This binds the
Employee's name
DropDownList1.DataValueField = datarow() 'This is where I would
like to bind the DataRow
DropDownList1.DataBind()
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
Label1.Text = ???? ' This is where I would like to access the
DataRows Values
End Sub
How do i go about doing this? Is it a good idea??
Thanks,
Ron