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

Grid access inside Panelbar

1 Answer 19 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 2
Michele asked on 10 Sep 2008, 05:39 PM

I created a Hierarchical Grid and everything works great.

I placed the RadGrid inside my RadPanelBar under
 

<

telerik:RadPanelItem runat="server" Text="Pages and Media" Expanded="True">
<Items
>
<telerik:RadPanelItem runat
="server">
<ItemTemplate
>
"My grid"


It works fine inside the panelbar.

However, I need to access 


Protected
Sub RadGrid1_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand

Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)

'Access the textbox from the edit form template and store the values in string variables.

Dim mediaType As String = (TryCast(editedItem("mediaType").Controls(0), TextBox)).Text

How can I accomplish this?


 

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 11 Sep 2008, 06:51 AM
Hi Michele,

I tried the following following code snippet to access the control in the FormTemplate of RadGrid.

VB:
Protected Sub RadGrid2_UpdateCommand(ByVal source As Object, ByVal e As GridCommandEventArgs) 
     
     Dim edititem As GridEditFormItem = DirectCast(e.Item, GridEditFormItem) 
     Dim txtbx As TextBox = DirectCast(edititem.FindControl("TextBox1"), TextBox) 
     Dim strtxt As String = txtbx.Text 
 End Sub 


Thanks
Shinu.

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