AxleWack AxleWack - 4 months ago 15
Vb.net 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

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
Comments