Tree Binding

3 posts, 0 answers
  1. Venkat
    Venkat avatar
    5 posts
    Member since:
    Jul 2010

    Posted 02 Sep 2010 Link to this post

    Dear Friends,
     I am using SQL Table with Fields,
    • MENU_ID (Primary key with autoincrement values)
    • PARENT_ITEM (int) (for storing parent id's)
    • CHILD_ITEM (string) (for storing text values)

    I have binded the value to tree view control as

           "List<clsMenu> listmenu = objadmin.GetMenuValues();
            trRolePrivilages.DataTextField = "CHILD_ITEM";
            trRolePrivilages.DataFieldID = "MENU_ID";
            trRolePrivilages.DataFieldParentID = "PARENT_ITEM";
            trRolePrivilages.DataSource = listmenu;
            trRolePrivilages.DataBind();"

    Now, when i am creating a role for particular user (example: marketing user), I need to select only particular items in treeview using checkboxes, after checking the particular items, it should get saved in my ROLE TABLE for that particular  user, these are all the items listed.

    so i need to populate those with menus

    so when admin login, he has all the menu items and when marketing user login, he has only limited number of items. What can i do?
    How to do this? cud anyone help me? Its very Urgent
  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 02 Sep 2010 Link to this post

    Hello Venkat,

    You should check the user that is logged into your application by looking at Page.User.Identity.Name, which will give you the username of the logged in user. From there you can filter the list based on the logged in user.

    I hope that helps.
  3. Venkat
    Venkat avatar
    5 posts
    Member since:
    Jul 2010

    Posted 03 Sep 2010 Link to this post

    Thanks for your reply "Cori".
    But my doubt is
    • How can i get the id of only checked parent and child items
    • How can i store that id in SQL

    The table structure to store is show in attachement. I need to store the checked values and id in this structure

    How can i?  Please help...
Back to Top