I need to build a control that emulates the Windows Forms PropertyGrid using Syncfusion grids. I''d thought about using the GridGroupingControl, etc. but it strikes me that there may be a better way to do this.
Assuming that I can control the type, colour etc. of a cell in the right-hand column of a GridListControl, I guess that I can use multiple of these embedded within cells in an outer grid.
The question is, can I emulate the expand/contract row behaviour of the standard windows control easily, and do you have any samples that I could look at?
ADAdministrator Syncfusion Team September 17, 2004 09:33 AM
>>The question is, can I emulate the expand/contract row behaviour of the standard windows control easily, and do you have any samples that I could look at?
The operative word here is ''easily''. Right now I would say the answer is no. You do have to do significant work to get this functionality UNLESS you can express your data in some kind of hiearchical format that can work with a GridDataBoundGrid as in the grid\samples\databound\hierarchical\expand sample (or customer sample). If you can do this, you can get the expand/contract using that grid in a straight forward way.
It you want to show flat data in some ''related to'' relation among the items in teh flat table, there is no grid that directly supports this as of now. We will support this type of things in the next few months.
If you want to do something now, there are several ways to go about this. One is use something along the way of the grid\samples\indepth\virttreegrid sample. But you would have to express your data in something like the collapsible datasource used there.
MWMike WoolleySeptember 20, 2004 02:23 AM
Thanks for your hints. I imagine that it shouldn''t be too difficult to express the data in a hierarchy, so I''ll explore the virttreegrid example more closely.
ADAdministrator Syncfusion Team September 20, 2004 03:31 AM
If you can get it in a hierarchy, then you might want to look at both the \220.127.116.11\Grid\Samples\DataBound\Hierarchical\ExpandGrid and \18.104.22.168\Grid\Samples\DataBound\Hierarchical\GDBGTreeLines samples.
MWMike WoolleySeptember 20, 2004 06:51 AM
So far so good. I''ve managed to reduce things into a parent/child relation. However, I''m getting the following exception when I try to expand the child table..
ystem.ArgumentException: The relation is not parented to the table to which this DataView points.
at System.Data.DataView.CreateChildView(DataRelation relation, Int32 recordIndex)
at System.Data.DataRowView.CreateChildView(DataRelation relation)
at System.Data.DataRelationPropertyDescriptor.GetValue(Object component)
at Syncfusion.Windows.Forms.Grid.GridModelDataBinder.GetChildList(PropertyDescriptor relation, Object component)
at Syncfusion.Windows.Forms.Grid.GridModelDataBinder.ExpandRecord(Int32 gridPosition)
at Syncfusion.Windows.Forms.Grid.GridDataBoundGrid.ExpandAtRowIndex(Int32 rowIndex)
at Syncfusion.Windows.Forms.Grid.GridDataBoundGrid.OnCellButtonClicked(GridCellButtonClickedEventArgs e)
at Syncfusion.Windows.Forms.Grid.GridControlBase.RaiseCellButtonClicked(Int32 rowIndex, Int32 colIndex, Int32 index, GridCellButton button)
catched at Syncfusion.Windows.Forms.Grid.GridControlBase.RaiseCellButtonClicked(Int32 rowIndex, Int32 colIndex, Int32 index, GridCellButton button) in :line 0
As far as I can see, the code I have is a direct copy from your sample. Any ideas what might be wrong here?