Hi Tuong,
Thanks for using Syncfusion products.
Query#1:”Expand/Collapse based on condition”
We suggest you to expand all records in the Hierarchy Grid
in the QueryCellStyleInfo event and then collapse the records based on some
condition by handling RecordExpanded event. Please refer to the code snippet
below to achieve this.
[CS]
void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.TableCellType == GridTableCellType.RecordPlusMinusCell)
{
Record r = e.TableCellIdentity.DisplayElement.ParentRecord as Record;
r.NestedTables[0].ParentTable.ExpandAllRecords();//Expanding all records of the Parent table
}
}
void GridGroupingControl1_RecordExpanded(object sender, RecordEventArgs e)
{
if (e.Record.GetValue("ParentName")!=null && e.Record.GetValue("ParentName").ToString() == "parentName0")
{
e.Record.IsExpanded = false; // Collapsing the record of Parent Table with the value 'parentName0'
}
}
Query#2:” Refreshing only child
table”
We would like to let you know that
refreshing child grid only when it’s data is added/edited cannot be achieved in
our current implementation. Adding/Modifying
data in Child Table will refresh the whole grid.
Please refer to the below link to download the sample
application.
threelvl-hierarchy-web.zip
Please let us know if you have any concern.
Regards,
Ranjithkumar.