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?
Many thanks!
AD
Administrator
Syncfusion Team
September 17, 2004 02:33 PM UTC
>>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.
MW
Mike Woolley
September 20, 2004 07:23 AM UTC
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.
AD
Administrator
Syncfusion Team
September 20, 2004 08:31 AM UTC
If you can get it in a hierarchy, then you might want to look at both the \2.1.0.9\Grid\Samples\DataBound\Hierarchical\ExpandGrid and \2.1.0.9\Grid\Samples\DataBound\Hierarchical\GDBGTreeLines samples.
MW
Mike Woolley
September 20, 2004 11:51 AM UTC
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?