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.
Syncfusion Feedback

GridDataBoundGrid + Hirachie View

Thread ID:

Created:

Updated:

Platform:

Replies:

8517 Nov 10,2003 01:06 PM UTC Nov 11,2003 05:28 AM UTC Windows Forms 2
loading
Tags: GridControl
Georg Schmidt
Asked On November 10, 2003 01:06 PM UTC

Hi, I would like to achieve that the parent record only displays the plus, when a child record is available in a relation. This is the "normal" behavior after you have clicked a record with no child record. Is there a way to handle it programatically/automatically? (I've more then 100.000 records in the grid...) img1.gif shows the records after binding. img2.gif shows the goal, after manually selecting any record... Thanks in advance, Georg

Administrator [Syncfusion]
Replied On November 10, 2003 03:53 PM UTC

> Hi, > > I would like to achieve that the parent record only displays the plus, when a child record is available in a relation. > > This is the "normal" behavior after you have clicked a record with no child record. > > Is there a way to handle it programatically/automatically? (I've more then 100.000 records in the grid...) > > img1.gif shows the records after binding. > img2.gif shows the goal, after manually selecting any record... > > Thanks in advance, > > Georg Here is a sample that initially shows a - if a row has no children. It does so by handling the DrawCell event and drawing the cell there using the right bitmaps. There is a little helper routine that checks if the row has children. Instead of changing it to a - sign, you could make it a blank if that is what you need. You can change the DrawCell code to start out
if(e.ColIndex == 1 && e.RowIndex > grid.Model.Cols.HeaderCount)
{
	bool noChildren = !HasChildrenAtRow(e.RowIndex);
	if( noChildren)
	{
		e.Cancel = true;
		Syncfusion.Drawing.BrushPaint.FillRectangle(e.Graphics, e.Bounds, grid.GetInterior(e.Style.Interior));
		return;
	}
	object o = e.Style.CellValue;
	if(o.Equals(-1) || o.Equals("") ||
		(!grid.IsExpandedAtRowIndex(e.RowIndex)  && noChildren )) 
			o = (int)1;
//......

Georg Schmidt
Replied On November 11, 2003 05:28 AM UTC

Thank you for your fast help. Georg

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.

Warning Icon 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.Close Icon

;