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

Hierarchical

Hi I still have a refresh problem on my hierarchical grid....... I am sorry for asking again, but, it makes me depressed :) Check on our ExpandGrid in the Essential Suite Sample \ DataBound \ hierarchical \ ExpandGrid * Expand a row --> for exemple : expand 3 - Confections * Modify categoryID of the row --> for exemple : replace 3 by 33 the childs automaticly change their key value * then, clic on child rows : They disappear!!! * then, To have the right display, you need to collapse the row and expand it again! So, how to refresh it correctly? bye! THANKS AGAIN! Syl

2 Replies

AD Administrator Syncfusion Team May 4, 2004 02:43 AM

I was able to avoid this problem in expandgrid by handling these two events.
bool processedValidating = false;
private void gridDataBoundGrid1_CurrentCellValidated(object sender, System.EventArgs e)
{
	processedValidating = true;
}
private void gridDataBoundGrid1_CurrentCellMoved(object sender, GridCurrentCellMovedEventArgs e)
{
	if(processedValidating)
	{
		GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
		int row = cc.MoveFromRowIndex;
		if(this.gridDataBoundGrid1.IsExpandedAtRowIndex(row))
		{
			GridBoundRecordState rs = this.gridBinder.GetRecordStateAtRowIndex(row);
			if(rs.LevelIndex == 0 && 
				this.gridBinder.NameToColIndex("CategoryID") == cc.MoveFromColIndex)
			{
				this.gridDataBoundGrid1.BeginUpdate();
				this.gridDataBoundGrid1.CollapseAtRowIndex(row);
				this.gridDataBoundGrid1.ExpandAtRowIndex(row);
				this.gridDataBoundGrid1.EndUpdate();
			}
		}
	}
	processedValidating = false;
}


SY Syl May 5, 2004 12:49 AM

Thanks Clay It''s working fine! Bye Sylvain

Loader.
Live Chat Icon For mobile
Up arrow icon