DB using LINQ
$30-600 USD
货到付款
how the `GridView` control can be nested to show master/detail relationships for multilevel hierarchal data. In this article, I have implemented it for three levels, and it can be implemented for *n* levels quite easily, by maintaining the information about the edit index of the parent `GridView` controls.
## Deliverables
The parent `GridView` is templated for all columns selected in the `SelectCommand`. As you can see, in the code, there is one more template field named ‘`View`’ which is the only part where the magic lies! In its `IetmTemplate`, there is a button with the `Text`, ‘+’, and `CommandName`, ‘Edit’. This plus sign button, when clicked, lets the `GridView` to enter edit mode, and fires the `OnRowEditing` event which is handled. What is to be shown in the edit mode is implemented in the `EditItemTemplate`. As shown in the code, it has a button with `CommandName` 'Cancel' and `Text` ‘-’ (to collapse the `GridView` by just running the `Cancel` command, which resets the edit index to -1 and the `ParentGridView` comes out of editing mode; obviously, the `ChildGridView` shown in edit mode will no longer be visible, which gives the notion of collapsibility). Next to the Cancel ‘-' button is a `ChildGridView`.
项目ID: #3227006