This is a migrated thread and some comments may be shown as answers.

Using Hierarchy strange issue...

1 Answer 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brad Dillon
Top achievements
Rank 2
Brad Dillon asked on 04 Dec 2008, 10:06 PM
Hello,

We are trying to implement the hierarchy grid and as far as getting the data and displaying it, it works without a problem.  The catch is that we are trying to take it a step further where if a user has certain permissions they will be able to:

  • Delete a row
  • Select a row, which then will open a modalpop or a radwindow for editing, as we have more information available to edit then what we display in the grid itself.
  • Create a new item within the 'main' row.

Basically we built a custom project/task manager where a project or task is level 1, and a task can have subtask related to it and so on.  When I tried to manually add the columns in the codebehind the hierarchy function ceased to work (clicking on the little arrow to show the details table(s) underneath no longer functioned).

But the main issue is that we need to be able to show/hide options based on a users role (permissions).

Any help would be much appreciated.

Brad

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 05 Dec 2008, 11:00 AM
Hi Brad ,

Are yoy trying to create the hierarchy dynamically  at runtime while having declarative grid columns  for the master table . Then this might be the cause for the issue.
 
Check out the link below for more information on programmatic creation of hierarchial grid.

http://www.telerik.com/help/aspnet-ajax/grdprogrammaticcreation.html

You can show/hide options based on the user as follows:

 protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
        if (e.Item is GridCommandItem &&   e.Item.OwnerTableView.Name=="DetailTables")  
        {  
            GridCommandItem cmdItem = (GridCommandItem)e.Item;  
            LinkButton lnkbtn = (LinkButton)cmdItem.FindControl("InitInsertButton");  
           if(User.IsinRole=="Admin")  
            lnkbtn.Visible=true;  
           else  
            lnkbtn.Visible=false;  
 
        }  
    }   
 



Thanks,
Princy
Tags
Grid
Asked by
Brad Dillon
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or