4 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 02 Nov 2009, 08:24 AM
Hi,
Try the code snippet below to access the control in the parent item on clciking a button in the detail table
Thanks,
Shinu
Try the code snippet below to access the control in the parent item on clciking a button in the detail table
| protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) |
| { |
| if (e.CommandName == "CustomCommand") |
| { |
| GridDataItem dataItem = (GridDataItem)e.Item; |
| GridDataItem parentItem = (GridDataItem)dataItem.OwnerTableView.ParentItem; |
| } |
| } |
Thanks,
Shinu
0
Randy
Top achievements
Rank 1
answered on 02 Nov 2009, 07:00 PM
With the above while expaning I get the ParentItem is nothing
Here is my Code:
Here is my Code:
Protected Sub rgPrismQA_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgPrismQA.ItemCommand
Dim mecb As MutuallyExclusiveCheckBoxExtender = Nothing
Select Case e.CommandName
Case RadGrid.ExpandCollapseCommandName
Dim di As GridDataItem = e.Item
Dim pi As GridDataItem = di.OwnerTableView.ParentItem
End Select
End Sub
So here When expanding pi is nothing and I can't find the control. Any Ideas?
0
Randy
Top achievements
Rank 1
answered on 03 Nov 2009, 06:52 PM
Does anyone have any ideas on this?
0
Shinu
Top achievements
Rank 2
answered on 04 Nov 2009, 05:22 AM
Hi Randy,
I guess you want to access the control placed in the griditem which is expanded/collapsed. If so you can try the following code snippet.
VB:
-Shinu.
I guess you want to access the control placed in the griditem which is expanded/collapsed. If so you can try the following code snippet.
VB:
| Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) |
| Select Case e.CommandName |
| Case RadGrid.ExpandCollapseCommandName |
| Dim di As GridDataItem = DirectCast(e.Item, GridDataItem) |
| Dim textbox1 As TextBox = DirectCast(di.FindControl("TextBox1"), TextBox) |
| ' Where TextBox1 is placed in the templatecolumn of expanded/collapsed item |
| Exit Select |
| End Select |
| End Sub |
-Shinu.