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

Implementing SharePoint Security on controls in RadGrid

4 Answers 42 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Eric Skaggs
Top achievements
Rank 2
Eric Skaggs asked on 09 Jan 2009, 08:00 PM
This is more of a "when to do it" rather than a "how to do it" type of question.

I've got some great things going on with the RadGrid control in a SharePoint Application Page.  Being that it's in a SharePoint environment, I'm going to leverage SharePoint Security to show/hide ASP Buttons and ASP LinkButtons within the grid.  When would be the best time to do this?  I'm thinking it would make sense to do this in the PreRender method of the grid.  In PreRender, I'd check what SharePoint groups the currently logged-in user is a member of and then set the Visible property of the corresponding buttons based on that.  Is that the best time to do this?

Thanks,

Eric Skaggs

4 Answers, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 12 Jan 2009, 02:26 PM
Hi Eric Skaggs,

In general case the most appropriate place to modified controls which are placed inside RadGrid's items is ItemCreated event, as this event is raised on every postback and the state of the controls will be preserved.

Please let us know if this information is helpful.

Best wishes,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Eric Skaggs
Top achievements
Rank 2
answered on 12 Jan 2009, 04:21 PM
Yes, very helpful, thank you.

That makes sense for controls that exist within an item.  I also have controls in the CommandItemTemplate and I'm using the PreRender method to modify those since they don't really exist within the context of an 'item.'  Please let me know if that is not appropriate.  I'll mark your response as the answer.
0
Accepted
Rosen
Telerik team
answered on 12 Jan 2009, 05:34 PM
Hi Eric Skaggs,

It highly depends on what modification are made to the controls. As you may know the CommandItem will be recreated on postback, thus if you are modifying its controls collection, for example adding or removing controls this should be done in ItemCreated event too.

Greetings,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Eric Skaggs
Top achievements
Rank 2
answered on 12 Jan 2009, 07:04 PM
Very good, thank you.
Tags
Grid
Asked by
Eric Skaggs
Top achievements
Rank 2
Answers by
Rosen
Telerik team
Eric Skaggs
Top achievements
Rank 2
Share this question
or