this.treeGrid.CurrentCellEndEdit += TreeGrid_CurrentCellEndEdit;
double total = 0; private void TreeGrid_CurrentCellEndEdit(object sender, Syncfusion.UI.Xaml.Grid.CurrentCellEndEditEventArgs e) {
var childNode = this.treeGrid.GetNodeAtRowIndex(e.RowColumnIndex.RowIndex);
//if more than one parent node is achieved ,you need to check those levels
for (int i = childNode.Level; i > 0; i--)
{
CheckChildNode(childNode.ParentNode);
childNode = childNode.ParentNode;
}
}
private void CheckChildNode(TreeNode treeNode)
{
//Check whether the treeNode is null or not
if (treeNode != null)
{
var p = treeNode.Item as Employee;
if (treeNode.ChildNodes.Count != 0)
{
//if more than one treeNode is achieved ,you need to check those levels
foreach (var childNode in treeNode.ChildNodes)
{
//Called recursively , to traverse it inner level of group.
CheckChildNode(childNode);
}
}
else
{
total = p.Salary + total;
}
p.Salary = total;
total = 0;
}
} |