How to add, edit & delete data into database using treeview with checkbox in ASP.NET MVC with entity framework.


How to add,Edit and delete data into database using treeview with checkbox in ASP.NET MVC with entity framework.


Asked by:- Revathi
0
: 3860 At:- 4/23/2018 11:04:46 AM
asp.net mvc oracle







1 Answers
profileImage Answered by:- jaya

It should be simple as you do normal CRUD operations, here are the steps to follow

  1. Follow this tutorial https://qawithexperts.com/article/asp.net/dynamic-treeview-in-aspnet-mvc-from-database/83 (I saw your comment below the article, and looks like you are already doing this)
  2. Create a page to list all the nodes and sub-nodes of the tree (you need to simply fetch the treeview table data from database using Entity framework, you can check article https://qawithexperts.com/article/asp.net/mvc-tutorial-part-2-connecting-to-database-fetchinginserting/29)
  3. Next step is to simply apply the CRUD operations on the database table.(Follow this article for CRUD: https://qawithexperts.com/article/asp.net/performing-crud-operations-in-aspnet-mvc-using-jqgrid-explan/82)
  4. Here the extra step would be to specify the user(while editing a node or deleting it) that it has sub-nodes.

that's it, you can perform CRUD operation on treeview table as you do with any other table data.

Extra tip: If you need to add a node in treeview at any order, create an extra int column in your treeview table as "Order" and ask user to input the value, when showing treeview data, sort it according to "Order" column value.

2
At:- 4/23/2018 11:58:47 AM






Login/Register to answer
Or
Register directly by posting answer/details

Full Name *

Email *




By posting your answer you agree on privacy policy & terms of use