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

How to show Edit Column only If the RadGrid is Editable

1 Answer 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Piet
Top achievements
Rank 1
Piet asked on 24 Mar 2010, 04:07 PM
How can I show the Edit Column only if the RadGrid is Editable?

I'm using DotNetNuke and only a few users have permission to edit the grid.

<telerik:GridEditCommandColumn ButtonType="ImageButton"
                        UniqueName="EditCommandColumn" Visible="false"/>

1 Answer, 1 is accepted

Sort by
0
Foenix
Top achievements
Rank 1
answered on 24 Mar 2010, 08:19 PM
Handle RadGrid's ItemCreated event.

protected void rgAccessGroup_ItemCreated(object sender, GridItemEventArgs e) 
    if (e.Item is GridEditableItem && UserHasNoEditRights) 
    { 
        ((GridEditableItem)e.Item)["UniqueNameOfGridEditCommandColumn"].Enabled = false
    } 

Of course, you have to replace UserHasNoEditRights and UniqueNameOfGridEditCommandColumn with your values/variables.
-----------------------------------------------------------------------------------
Ok, it was not exactly what do you want. More accurate answer to your question is:

protected void rgAccessGroup_ItemCreated(object sender, GridItemEventArgs e) 
    if (e.Item is GridEditableItem && UserHasNoEditRights) 
    { 
        ((GridEditableItem)e.Item)["EditCommandColumn"].Visible = false
    } 
 


Tags
Grid
Asked by
Piet
Top achievements
Rank 1
Answers by
Foenix
Top achievements
Rank 1
Share this question
or