We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Access second-level nested items

I am developing a sfdatagrid with a master, a child to the master, and a child to that, so three levels ... essentially, there is a company, a branch in that company, and events that branch has completed.

I can access the "company" by selecting the row and accessing it using vb.net as follows: 
Dim v = gridCompany.CurrentItem
Dim r As System.Data.DataRow = v.row

I can access the "branch" by selecting the row in the expanded detail view and access it as follows:
Dim v = gridCompany.SelectedDetailsViewGrid.CurrentItem
Dim r As System.Data.DataRow = v.Row

So if i want to access the "events" by selecting one of those rows (a child detail view to the "branch") how do i get that selected row?


4 Replies

JP Jagadeesan Pichaimuthu Syncfusion Team February 25, 2019 12:37 PM UTC

Hi Christopher, 
Thanks for contacting Syncfusion support. 
We have forwarded this to our development team for analysis. we will update you with details on February 26, 2019. 
We appreciate your patience until then. 

JP Jagadeesan Pichaimuthu Syncfusion Team February 26, 2019 09:42 AM UTC

Hi Christopher, 
Thanks for your patience. 
Please make use of the following code snippet to get the row selected in the details view grid. 
Code snippet :   
if (sfDataGrid1.SelectedDetailsViewGrid != null) 
    var dataGrid = sfDataGrid1.SelectedDetailsViewGrid; 
    while (dataGrid.NotifyListener != null) 
        if (dataGrid.SelectedDetailsViewGrid != null) 
            dataGrid = dataGrid.SelectedDetailsViewGrid; 
    var currentItem = dataGrid.CurrentItem; 
Let us know whether this helps also if you need any further assistance on this. 

CS Christopher Scholl March 1, 2019 02:14 AM UTC

this gets the 1st nested grid (the child) but it doesn't get the child of the child, the second nested grid.

JP Jagadeesan Pichaimuthu Syncfusion Team March 1, 2019 08:53 AM UTC

Hi Christopher, 
Thanks for your update. 
We have created a simple sample using the code snippet which we have provided in the last update and it is available in the following link for your reference. 
We are able to get the selected record from the second level nested grid in this sample. Please have a look at the given sample and if still the issue exists please let us know if we missed any customization you have done in your application. It will be helpful for us to provide an exact solution at earlier. 

Live Chat Icon For mobile
Up arrow icon