AxleWack AxleWack - 1 year ago 186 Question

RadGrid FindControl in EditTemplate

I am really starting to get frustrated with the Telerik controls! Everything always has to be different or over complicated!!

All I am trying to do is access a combobox in an editTemplate when clicking on a button(delete button) in the same EditTemplate - Thats it! But nothing works. Everything I find is using e.item within the RadGrids event.

If anyone knows how I can do this, please help!

Thank you.

Answer Source

I found the answer :

Protected Sub rbtnDeleteUploadedFile_Click(sender As Object, e As System.EventArgs)
    Dim btnDelete As RadButton = DirectCast(sender, RadButton)

    Dim item As GridEditFormItem = DirectCast(btnDelete.NamingContainer, GridEditFormItem)
    Dim rcboEditUploadedFiles As RadComboBox = DirectCast(item.FindControl("rcboEditUploadedFiles"), RadComboBox)

    Dim SelectedUploadFile As String

    SelectedUploadFile = rcboEditUploadedFiles.SelectedItem.Text

End Sub
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download