This is a migrated thread and some comments may be shown as answers.

FindControl in RowDrop event

1 Answer 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alex Tushinsky
Top achievements
Rank 2
Alex Tushinsky asked on 17 Jun 2011, 08:36 PM
I need to find a control that's contained in a Template column when I get into a RowDrop event.  The control is in the DraggedItem object, and is always null.  Any suggestions?

 Dim index As Integer = CInt(e.DraggedItems(0).ItemIndex)
 Dim oList As DropDownList = CType(RadGrid1.Items(index).FindControl("oList"), DropDownList)
 Dim s As String = oList.SelectedValue

Thanks,
Alex

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 Jun 2011, 07:25 AM
Hello Alex,
Try the following code snippet to achieve your requirement.
VB:
Protected Sub grdEmail_RowDrop(sender As Object, e As GridDragDropEventArgs)
    Dim item As GridDataItem = DirectCast(e.DraggedItems(0), GridDataItem)
    Dim oList As DropDownList= DirectCast(item.FindControl("oList"), DropDownList)
End Sub

Thanks,
Shinu.
Tags
Grid
Asked by
Alex Tushinsky
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Share this question
or