How would I got about finding controls in the Insert Item template without using the Item Databound Event? I want to be able to find the controls within a radio button list _SelectedIndexChanged event. I was able to do this with controls inside the EditTemplate:
Protected
Sub
rblEdit_SelectedIndexChanged(sender
As
Object
, e
As
EventArgs)
For
Each
item
As
GridItem
In
RadGrid1.MasterTableView.Items
If
item.Edit
Then
Dim
editItem
As
GridEditFormItem =
DirectCast
(RadGrid1.MasterTableView.GetItems(GridItemType.EditFormItem(item.ItemIndex), GridEditFormItem)
Dim
DDList
As
DropDownList =
DirectCast
(editItem.FindControl(
"ddlEdit"
), DropDownList)
Dim
RBLEdit
As
RadioButtonList =
DirectCast
(editItem.FindControl(
"rblEdit"
), RadioButtonList)
Dim
bTextBox
As
TextBox =
DirectCast
(editItem.FindControl(
"BTextbox"
), TextBox)
Dim
LBLPercent
As
Label =
DirectCast
(editItem.FindControl(
"lblPercent"
), Label)
If
RBLEdit.SelectedValue =
"No"
Then
DDList.Visible =
False
LBLPercent.Visible =
False
bTextBox.ForeColor = Drawing.Color.DarkRed
ElseIf
RBLEdit.SelectedValue =
"Yes"
Then
bTextBox.ForeColor = Drawing.Color.Green
DDList.Visible =
True
LBLPercent.Visible =
True
End
If
End
If
Next
End
Sub