T
tshad
If we have nested controls, how do we easily find the parent?
I know how to find Child controls - I would do something like:
****************************************************************************************
Sub OnSelectIndexChanged(sender as Object,e as DataListCommandEventArgs)
trace.warn("inside OnSelectIndesChanged")
try
InfoLabel.Visible = False
if e.CommandName = "Select" then
DataList1.SelectedIndex = e.Item.ItemIndex
end if
dim refCode as Label = e.Item.FindControl("lblRefCode")
Dim oRepeater as Repeater =
CType(DataList1.Items(DataList1.SelectedIndex).FindControl("Repeater1"),Repeater)
Dim oDetail as CheckBox =
CType(DataList1.Items(DataList1.SelectedIndex).FindControl("DetailCheck"),CheckBox)
Dim oBut as ImageButton =
CType(DataList1.Items(DataList1.SelectedIndex).FindControl("ExpandButton"),ImageButton)
*******************************************************************************************
But what if I push a button in a child control and need to get to the Parent
control? Is there an easy way to do this?
Thanks,
Tom.
I know how to find Child controls - I would do something like:
****************************************************************************************
Sub OnSelectIndexChanged(sender as Object,e as DataListCommandEventArgs)
trace.warn("inside OnSelectIndesChanged")
try
InfoLabel.Visible = False
if e.CommandName = "Select" then
DataList1.SelectedIndex = e.Item.ItemIndex
end if
dim refCode as Label = e.Item.FindControl("lblRefCode")
Dim oRepeater as Repeater =
CType(DataList1.Items(DataList1.SelectedIndex).FindControl("Repeater1"),Repeater)
Dim oDetail as CheckBox =
CType(DataList1.Items(DataList1.SelectedIndex).FindControl("DetailCheck"),CheckBox)
Dim oBut as ImageButton =
CType(DataList1.Items(DataList1.SelectedIndex).FindControl("ExpandButton"),ImageButton)
*******************************************************************************************
But what if I push a button in a child control and need to get to the Parent
control? Is there an easy way to do this?
Thanks,
Tom.