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

Hierarchy access

2 Answers 72 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Maxime
Top achievements
Rank 1
Maxime asked on 23 Jan 2013, 08:33 PM
Hi everyone,

In this other question of mine, I am facing a different problem than the previous one.

I currently have a grid, inside a radtabstrip inside a grid. In order to makes this easier, here is the name of the items.

Parent grid : grdChauffeurs
Tabstrip : RadTabStrip2
Inner grid : grdOrdre

Here is what I would like to achieve.

When I drop a row in grdDriver, I want the row to be added in the grid grdOrdre.

In my rowdrop event I have the following code :

Protected Sub grdListeCommande_RowDrop(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDragDropEventArgs) Handles grdListeCommande.RowDrop
            Dim RowDragged As GridDataItem
            Dim RowIndexDestin As Integer
            Dim intChfNRI As Integer
            Dim intAtcNRI As Integer
            Dim tabstrip As RadTabStrip
            Dim grille As RadGrid = Nothing
 
            For Each item As GridNestedViewItem In grdChauffeurs.MasterTableView.GetItems(GridItemType.NestedView)
                tabstrip = item.FindControl("RadTabStrip2")
                grille = tabstrip.MultiPage.FindControl("grdOrdre")
            Next
 
            RowDragged = e.DraggedItems.FirstOrDefault()
 
            If (e.DestDataItem IsNot Nothing) Then
                If (e.DestDataItem.OwnerGridID = grdChauffeurs.ClientID) Then
                    Me.RowIndex = e.DestDataItem.ItemIndex
 
                    intAtcNRI = CInt(RowDragged("ATCNRI").Text)
                    intChfNRI = Me.DataTableChauffeur.Rows(Me.RowIndex).Item("NRI")
                End If
 
                Select Case False
                    Case intChfNRI <> Nothing
                    Case intAtcNRI <> Nothing
                    Case pfblnGetRoadSheet(intChfNRI, intAtcNRI)
                    Case Else
                        e.DestDataItem.Expanded = False
                        e.DestDataItem.Expanded = True
                        grille.DataSource = Me.DataTableMouvement
                End Select
                
            End If
        End Sub

I am a new developper and I'm a bit confused with how all the hierarchy works in the radgrid.

Thank you in advance for you most appreciated help

Max

2 Answers, 1 is accepted

Sort by
0
Accepted
Kostadin
Telerik team
answered on 28 Jan 2013, 12:20 PM
Hi Maxime,

I suggest you to check out the following help article which describes how the hierarchy in RadGrid works.

I hope this information helps.

All the best,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Maxime
Top achievements
Rank 1
answered on 30 Jan 2013, 02:46 PM
Hi,

I should have posted before but I found a solution to my problem.

Thanks
Tags
Grid
Asked by
Maxime
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Maxime
Top achievements
Rank 1
Share this question
or