Pivot Grid double click to see detail

1 Answer 104 Views
PivotGrid and PivotFieldList
Informatica
Top achievements
Rank 1
Iron
Informatica asked on 18 Apr 2022, 12:27 PM | edited on 19 Apr 2022, 03:39 PM

Hello,

please, how can I do a double-click-cell-event to see in a pop-dialog the detail rows in a pivot grid?

I have try it, but It doesn´t works.

I add my basic code of pivot grid (UPDATED WITH THE CODE OF UNDERLYING)

Thank you!

-------

updates of today: Now, the gridview show columns: rowerror, rowstate, ...

I upload the updated code.

Please, can you help me? Thanks!

Informatica
Top achievements
Rank 1
Iron
commented on 19 Apr 2022, 08:29 PM

Solved!

  Private Sub radPivotGrid1_MouseDoubleClick(ByVal sender As Object, ByVal e As MouseEventArgs) Handles RadPivotGrid1.DoubleClick
        If e.Button = MouseButtons.Left Then
            Dim pivotGrid As RadPivotGrid = CType(sender, RadPivotGrid)
            Dim cell As PivotCellElement = TryCast(pivotGrid.ElementTree.GetElementAtPoint(e.Location), PivotCellElement)

            If cell IsNot Nothing Then
                Dim row = cell.Row.Group
                Dim column = cell.Column.Group
                Dim localProvider As LocalDataSourceProvider = TryCast(pivotGrid.DataProvider, LocalDataSourceProvider)
                localProvider.GetUnderlyingData(row, column)
            End If
        End If
        Me.SplitContainer2.Panel2Collapsed = True
        MMostrarDetalleToolStripMenuItem_Click(Nothing, Nothing)
        Me.RadGridView1.BestFitColumns()

    End Sub

    Private Sub provider_GetUnderlyingDataCompleted(ByVal sender As Object, ByVal e As Telerik.Pivot.Core.DrillDown.DrillDownCompletedEventArgs)
        Dim underlyingData As IEnumerable = e.Result
        Me.RadGridView1.BeginInvoke(New Action(Function()

                                                   If e.InnerExceptions.Count = 0 Then
                                                       DisplayUnderlyingData(underlyingData)

                                                   End If
                                               End Function))
    End Sub

    Public Sub DisplayUnderlyingData(ByVal underlyingData As IEnumerable)
        Dim counter As Integer = 0
        Dim dt As DataTable = New DataTable()

        For Each row As DataRow In underlyingData
            If counter = 0 Then dt = row.Table.Clone()
            dt.Rows.Add(row.ItemArray.ToArray())
            counter += 1
        Next

        Me.radGridView1.DataSource = dt

    End Sub

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 20 Apr 2022, 10:14 AM

Hi,

I am glad that you have found a suitable solution for your scenario. The following help article is also quite useful for handling such a scenario:

https://docs.telerik.com/devtools/winforms/controls/pivotgrid/drilldown 

Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
PivotGrid and PivotFieldList
Asked by
Informatica
Top achievements
Rank 1
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or