According to the provided information, it is not clear enough whether you are using RadGridView
in bound or unbound mode and how exactly the hierarchy is set up. Could you please elaborate?
Without knowing the exact setup, I can give you only general suggestions how to add a new row to the child level.
If you set the DataSource
property (bound mode) for each GridViewTemplate
(master level and child level), in order to add a new record for the child template, it is necessary to add a new record to the DataSource
collection that is being applied to the child GridViewTemplate
. Since there is a relation (GridViewRelation
) between the two GridViewTemplates
indicating the child ID and the parent ID, it is important to specify the proper parent ID for the new record. Thus, the hierarchy row will be added to the respective parent row. A sample approach how the hierarchy is setup in this case is available in the "Setting the hierarchical grid in bound mode
" section in the following help article: https://docs.telerik.com/devtools/winforms/controls/gridview/hierarchical-grid/binding-to-hierarchical-data-programmatically
If you use unbound mode and you add the rows directly to the Rows
collection of the respective GridViewTemplate
, it is just necessary to add a new row which cell's value for the parent ID points to the desired parent row. A sample approach for this approach is demonstrated in the "Hierarchical Grid in Unbound mode
" section in the above referred article.
However, if you are still experiencing any further difficulties, it would be greatly appreciated if you can give us some more details about the precise case. A sample code snippet how you setup and populate the grid with hierarchical data would be greatly appreciated. Thus, we would get better understanding of the precise case and think about a suitable solution.
I hope this information helps. If you need any further assistance regarding the Telerik UI for WinForms suite please don't hesitate to contact me.
Dess | Tech Support Engineer, Sr.
Progress is here for your business, like always. Read more
about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.