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.
Unfortunately, activation email could not send to your email. Please try again.

Master Detail

Thread ID:

Created:

Updated:

Platform:

Replies:

124272 May 27,2016 05:50 PM May 31,2016 06:41 AM Windows Forms 3
loading
Tags: GridGroupingControl
DaniloS
Asked On May 27, 2016 05:50 PM

Hello,

by my understanding Master-Detail relation has access to all records in both tables Master and Child.

I would like to do it little different. Is it possible to show aditional detail table in main table in this way:
- I click record 
- only for specific record querry is executed and detail child table is shown



Adhikesevan Kothandaraman [Syncfusion]
Replied On May 30, 2016 08:39 AM

Hi Danilo, 

Thanks for using Syncfusion products. 

We have analyzed your reported scenario. We are little unclear with your requirement. We need the following details for better understanding, 

1.       Can you please let me know whether you want to display the child table of the parent record with the expand state? 
         
2.       Can you please let me know whether the child table of the parent record need to be shown in the same grid or need to show the child table items in the separate Grid? 

Regards, 
Adhi 


DaniloS
Replied On May 30, 2016 09:21 AM

Hello, 

thanks for reply. Answers are bellow:

1.       Can you please let me know whether you want to display the child table of the parent record with the expand state? 
Answer: Yes         

2.       Can you please let me know whether the child table of the parent record need to be shown in the same grid or need to show the child table items in the separate Grid? 
Answer: In separate grid is no problem for me. I would like to havit in same grid, like on picture bellow maybe:


Regards!

Adhikesevan Kothandaraman [Syncfusion]
Replied On May 31, 2016 06:41 AM

Hi Danilo,  
 
Thanks for your update. 
 
If you want to expand the record to show the child table details on clicking the record, you can use the TableControlCellClick event for this. In this event you can check the condition for expand only for the particular records. Please refer to the following code snippet, 
 
Code Snippet: 
this.hierarchyGrid.TableControlCellClick += new GridTableControlCellClickEventHandler(hierarchyGrid_TableControlCellClick); 
 
private void hierarchyGrid_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e) 
{ 
    GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex); 
    if (style.TableCellIdentity.DisplayElement.Kind == Syncfusion.Grouping.DisplayElementKind.Record) 
    { 
        Record CurrentRecord = style.TableCellIdentity.DisplayElement.GetRecord(); 
        //Add the condition here for expanding only the particular record 
        if (CurrentRecord.HasNestedTables && CurrentRecord.GetValue("ParentName").ToString() == "parentName3") 
        { 
            //Expand the child record to show the child table  
            CurrentRecord.SetExpanded(true, true, true); 
        } 
    } 
} 
 
Sample: 
 
Regards, 
Adhi 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;