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

GDBG with TreeLines and Icon

Hi, I''m trying to create a sample very close to syncfusions sample "GDBGTreeLines" where I try to show an icon after the treelines. But there are several handicaps that i can not handle. drawing the icon: ================= To draw the correct icon to the first column i handle the event "gdbg.PrepareViewStyleInfo" where i can set the e.imageIndex If e.RowIndex > 2 And e.ColIndex = 2 Then e.Style.ImageIndex = me.GetTheRightImageIndex End If This works, but unfortunately the image is drawn on the left side and not in the middle of treelines and text of the first textcolumn. How can i create the correct indent for the icon depending on the level of hierarchy? changing order of columns ========================= In my sample i bound the gdbg to a dataSet with several tables and hierarchic relations. For all tables the first column is the id, the second column is parentID. When i now hide the first and second column of the gdbg with ''Me.gdbg.Model.Cols.Hidden("id") = True Me.gdbg.Model.Cols.Hidden("parentId") = True then I cannot see the treelines anymore because treelines seem to be bound to the first column of the dataset. So i tried to change the order of columns with gdbg.Model.Cols.MoveRange(2, 2, 5) That works but only for the first level of hierarchy. In all other levels the order of columns is like the one in the dataset. How can I change the order of columns for all tables? style of treelines ================== Is it possible to change the style of treelines form solid to dotted? Hope that someone (Stanley ? ;-) has some ideas! thx, Klaus

2 Replies

ST stanleyj Syncfusion Team February 3, 2006 02:49 PM UTC

Hi Klaus, I am working on these and will get back to you with solution. Regards, Stanley


ST stanleyj Syncfusion Team February 6, 2006 07:29 AM UTC

Hi Klaus, On creating your own cellType DataBoundRowExpandCell that is used internally by deriving GridDataBoundRowExpandCellModel and GridDataBoundRowExpandCellRenderer, drawing the icon and style of treelines are possible. If you have the source code, you can take our code in \Src\Extensions\DataBound\GridDataBoundTreeCell.cs, and tweak it to draw the extra bitmap and set styles for the Pen to DrawLine. Then add the celltype through CellModels.Add function. this.gridDataBoundGrid1.Model.CellModels.Remove("DataBoundRowExpandCell"); this.gridDataBoundGrid1.Model.CellModels.Add("DataBoundRowExpandCell", new ExpandTreeLinesCellModel(this.gridDataBoundGrid1.Model)); drawing the icon ========== In the GridDataBoundRowExpandCellRenderer, the images can be added to cell after the +/- button using GridStaticCellRenderer.DrawImage function in OnDrawCellButton overrides and in the CellDrawn event. Drawing the icon is also possible without deriving GridDataBoundRowExpandCellRenderer, but using the DrawCellDisplayText as discussed in this thread below. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=37142 changing order of columns ================== You can programatically change the column order only for the first header row. However using the layout column, by rearranging it even the header row below can be moved. Please refer the thread below. http://www.syncfusion.com/support/forums/message.aspx?MessageID=39323 style of treelines =========== In the GridDataBoundRowExpandCellRenderer, the Pen that is used in DrawLine can be formatted. Pen p = new Pen(LineColor) p.DashStyle = DashStyle.Dot; Here is the sample implementing these. Best regards, Stanley

Loader.
Live Chat Icon For mobile
Up arrow icon