简体   繁体   中英

How to bind the gridview to treeview ,like tree structure hold the gridview data

How to bind the gridview control to treeview , when user click for the + symbol the gridview has to display.. like tree structure hold the gridview data

Thank You

A treeview holds text natively. It is not designed to hold object data in the fashion you're looking for. To achieve this effect you might be better served by nesting a gridview in a gridview with the plus symbol being in the left column as a link/imagebutton and the title or caption in the right column. When the button is clicked you can enter "edit" mode to bring up the edit template, and inside that template can be a separate gridview control that would be bound to the specific data in question. Then click the linkbutton again (which would have been changed to a minus I assume), you could exit edit mode and return to normal. The disadvantage would be that only one row would be able to be open at a time, but that could be worked around by using the regular item template and using viewstate properties to manage row states.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM