
I'm facing an issue with DataSet and gridgroupingcontrol.
I have a self relation on a table. Every row has childs, childs have childs etc ... I'm filling a DataTable with all of those line and use a DataSet relation like this :
DataRelation parentChildRelation = new DataRelation("ParentChild", ds.Tables[0].Columns["testNumericId"], ds.Tables[0].Columns["ParentIdNumeric"], false);Problem is when I want to display this DataSet. It has the parent with all the child + one line for every child in my gridgroupingcontrol.
Parent 1 Child 1 Child 1-1 Child 1-2 Child 2 Child 2-1 Child 2-1-1 Child 1 Child 1-1 Child 1-2 etc ...

Any idea on what could be the issue ? How can I hide those Childs (they shouldn't appear) and only show rows with -1 as ParentIdNumeric ?
Thanks.
|
Query |
Solution | |
|
Problem is when I want to display this DataSet. It has the parent with all the child + one line for every child in my gridgroupingcontrol. |
By default, every child table generating the AddNewRow before that recor details. In order to avoid this new row generating for every child, you can get the TableDescriptor for ChildTable using GetTableDescriptor method and disable the AllowNew preoperty. Please refer to the below code example,
Code
this.gridGroupingControl1.GetTableDescriptor("ChildTable”).AllowNew = false; | |
|
How can I hide those Childs (they shouldn't appear) and only show rows with -1 as ParentIdNumeric ? |
To display the specific row in the GridGroupingControl, you could use the QueryRowHeight event to hide the rows using Size property. Please refer to the below code example, KB link and the sample,
Code example
Sample link: GridGroupingControl
|