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

Problem with RadGrid and UserControl

1 Answer 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 2
Jason asked on 30 Sep 2008, 02:42 PM
I've managed to get data between the RadGrid and the UserControl during databinding (i.e. as the control is being displayed, before the user enters any data) but I am not able to get any data back from the UserControl once the PerformInsert command is called. Upon examining the contents of e.Item, there are only 2 controls in the container both with type "Telerik.Web.UI.GridEditFormItem+EditFormTableCell". I'm using the following code to attempt to access the UserControl:

    Sub ChannelsList_InsertCommand(ByVal sender As ObjectByVal e As GridCommandEventArgs) Handles ChannelsList.InsertCommand 
        If Not e.Canceled Then 
            Dim editedRow As GridEditableItem = CType(e.Item, GridEditableItem) 
            Dim channelEditor As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl) 
            Dim channelsFile As ChnFile = CType(Session("ChannelsFile"), ChnFile) 
            Dim channel As New Channel() 
 
            With channel 
                .Name = CType(editedRow.FindControl("tbxDisplayName"), RadTextBox).Text 
                .Phonetic = CType(editedRow.FindControl("tbxPhonetic"), RadTextBox).Text 
                .Comment = CType(editedRow.FindControl("tbxComment"), RadTextBox).Text 
            End With 
        End If 
    End Sub 


I've modeled the approach after the examples provided in the live demos and the documentation but nothing seems to be working. Any help would be greatly appreciated!

Thanks, Jason

1 Answer, 1 is accepted

Sort by
0
Jason
Top achievements
Rank 2
answered on 30 Sep 2008, 02:55 PM
Nevermind... I'm an idiot, I was trying to find the controls using the GridEditableItem as opposed to the UserControl

Thanks and Sorry

Jason
Tags
Grid
Asked by
Jason
Top achievements
Rank 2
Answers by
Jason
Top achievements
Rank 2
Share this question
or