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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GDBGRID and DataRelations

Thread ID:





36235 Oct 24,2005 05:19 PM UTC Oct 24,2005 11:13 PM UTC WinForms 7
Tags: GridControl
Stefan Tsalapatis
Asked On October 24, 2005 05:19 PM UTC

Hi, The grid ( based on your GDBGTreeLines sample) works ok with Binder.AddRelation but 1. My DataRelations link between internal keys and I want to display the treelines in a user data column for example ( ProductID - ChildProdID) to show the ProductCode with treeline. ( the only I can think is to handle it in QueryCellInfo changing the CellValue but what will happen with tree symbols) 2. Howto display only one header column row when I have a lot of Relations with the same columns Regards Stefan

Stefan Tsalapatis
Replied On October 24, 2005 05:36 PM UTC

Also 3. When I expand a level and some of the nodes have children and others have not then it shows all and those without children with expand symbol. and I must click on them to refresh it. How to avoid this ?

Administrator [Syncfusion]
Replied On October 24, 2005 05:37 PM UTC

1) You can try swapping out the display text in a DrawCellDisplayText event handler.
private void gridDataBoundGrid1_DrawCellDisplayText(object sender, GridDrawCellDisplayTextEventArgs e)
	if(e.Style.CellType == "DataBoundTreeCell")
		e.DisplayText = "x" + e.DisplayText;
2) You can hide header rows by setting the heights to zero. grid.Model.RowHeights.SetRange(1,2,0);

Stefan Tsalapatis
Replied On October 24, 2005 06:13 PM UTC

2. ok. 1 . I did this but in Model.QueryCellInfo because there I have easily information about the Row and Col. if(e.Style.CellType == "DataBoundTreeCell") e.Style.ellValue = Model[e.RowIndex,3].CellValue.ToString(); (where the 3rd column is hidden). Ok for the first level but in the lower levers, the binder displays the columns as they are and does not use the QueryCellInfo probably. Thanks

Administrator [Syncfusion]
Replied On October 24, 2005 06:54 PM UTC

3) Here is a forum thread that has code to handle this. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=25785 1)I think the code will work better in DrawCellDisplayText. You can get the RowIndex from e.Style.Cellidentity.RowIndex.

Stefan Tsalapatis
Replied On October 24, 2005 10:06 PM UTC

3. Forum Thread > No. It solves the problem but it delays unacceptably. 1. DrawCellDisplayText. The same with QueryCellInfo. The first level (Root) works ok . I have 3 columns plus 1 hidden and I display the hidden text in the column which links the relation. The Root is ok. When I expand the parent then the children nodes display all columns and the hidden. The Root Level has 3 visible columns , The Child Level has 4 visible columns. and it does not show the Text from the event. It seems that for every level the binder apply the defaults. Problems.. I am thinking to override the CellRenderer for the treecell. Regards

Administrator [Syncfusion]
Replied On October 24, 2005 10:31 PM UTC

1) Here is a sample with DrawCellDisplayText showing a value from some other grid column at all levels. What are you doing differently? http://www.syncfusion.com/Support/user/uploads/CS_6f62d708.zip

Stefan Tsalapatis
Replied On October 24, 2005 11:13 PM UTC

Clay, 1. The obvious difference that I saw immediately and fixed the problem is the call of GridHierarchyLevel.LayoutColumns(.. This code does not exist in 3-4 samples with hierarchical grids ( GDBGTreeLines, etc ) and the class reference does not give understandable information. It would be more productive to solve such simple (finally) problems and for us to exploit you :-) for more difficult issues. Thanks Regards


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