I have a button and a texbox in the Edit Template that I need to access from the code behind. I tried the following code and it didn't work, does anyone have an example of this?
| Dim btn As Button = TryCast(sender, Button) |
| Dim btnPanel As Panel = TryCast(btn.Parent, Panel) |
| Dim dataItem As GridDataItem = TryCast(btnPanel.NamingContainer, GridDataItem) |
| dataItem("Button1").Enabled = False |
| Dim txt As TextBox = TryCast(sender, TextBox) |
| Dim txtPanel As Panel = TryCast(txt.Parent, Panel) |
| Dim dtItem As GridDataItem = TryCast(txtPanel.NamingContainer, GridDataItem) |
| If (Utilities.FileExists("GlobalReports\" & dtItem("txtReportFile").Text)) Then |
| 'Do some stuff |
| End If |