Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
QuestionDynamic attributes for propertyGrid??? Pin
LongRange.Shooter9-Feb-04 3:11
LongRange.Shooter9-Feb-04 3:11 
AnswerRe: Dynamic attributes for propertyGrid??? Pin
Heath Stewart9-Feb-04 4:17
protectorHeath Stewart9-Feb-04 4:17 
GeneralRe: Dynamic attributes for propertyGrid??? Pin
LongRange.Shooter9-Feb-04 8:09
LongRange.Shooter9-Feb-04 8:09 
GeneralRe: Dynamic attributes for propertyGrid??? Pin
Heath Stewart9-Feb-04 9:33
protectorHeath Stewart9-Feb-04 9:33 
GeneralRe: Dynamic attributes for propertyGrid??? Pin
LongRange.Shooter9-Feb-04 10:38
LongRange.Shooter9-Feb-04 10:38 
GeneralRe: Dynamic attributes for propertyGrid??? Pin
Heath Stewart9-Feb-04 14:02
protectorHeath Stewart9-Feb-04 14:02 
GeneralRe: Dynamic attributes for propertyGrid??? Pin
LongRange.Shooter10-Feb-04 8:58
LongRange.Shooter10-Feb-04 8:58 
GeneralRe: Dynamic attributes for propertyGrid??? Pin
Heath Stewart10-Feb-04 11:18
protectorHeath Stewart10-Feb-04 11:18 
PropertyDescriptor has a protected constructor that you should override that takes and initializes the PropertyDescriptor from a MemberDescriptor, which you can get with TypeDescriptor.GetProperties(this, true). In your override for IsReadOnly, you can use metadata to determine if the user can set them or not. I do this very thing in our application based on dynamic properties pulled form a database. As I mentioned before, it you utility role-based security, this gets very easy. That attribute I mentioned before would have the groups (or roles) that can set the property. Your IsReadOnly override gets the list, calls IPrincipal.IsInRole and if it returns true for any of those roles, you return false. If not, return true (read-only).

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Dynamic attributes for propertyGrid??? Pin
LongRange.Shooter11-Feb-04 7:49
LongRange.Shooter11-Feb-04 7:49 
GeneralRe: Dynamic attributes for propertyGrid??? Pin
Heath Stewart11-Feb-04 9:14
protectorHeath Stewart11-Feb-04 9:14 
GeneralRe: Dynamic attributes for propertyGrid??? Pin
LongRange.Shooter11-Feb-04 10:45
LongRange.Shooter11-Feb-04 10:45 
GeneralRe: Dynamic attributes for propertyGrid??? Pin
Heath Stewart11-Feb-04 11:53
protectorHeath Stewart11-Feb-04 11:53 
GeneralCommand Line Pin
GetOn&GetGoing8-Feb-04 23:43
GetOn&GetGoing8-Feb-04 23:43 
GeneralRe: Command Line Pin
Heath Stewart9-Feb-04 1:30
protectorHeath Stewart9-Feb-04 1:30 
QuestionHow to execute a file Pin
Jonathan Slenders_8-Feb-04 22:41
sussJonathan Slenders_8-Feb-04 22:41 
AnswerRe: How to execute a file Pin
Mazdak8-Feb-04 23:20
Mazdak8-Feb-04 23:20 
GeneralRe: How to execute a file Pin
Jonathan Slenders9-Feb-04 0:22
Jonathan Slenders9-Feb-04 0:22 
GeneralRe: How to execute a file Pin
Heath Stewart9-Feb-04 1:28
protectorHeath Stewart9-Feb-04 1:28 
AnswerRe: How to execute a file Pin
Mike Clark9-Feb-04 12:13
Mike Clark9-Feb-04 12:13 
QuestionHow to reduce size? Pin
GetOn&GetGoing8-Feb-04 20:22
GetOn&GetGoing8-Feb-04 20:22 
AnswerRe: How to reduce size? Pin
Mazdak8-Feb-04 21:31
Mazdak8-Feb-04 21:31 
GeneralRe: How to reduce size? Pin
GetOn&GetGoing8-Feb-04 21:35
GetOn&GetGoing8-Feb-04 21:35 
GeneralRe: How to reduce size? Pin
Colin Angus Mackay8-Feb-04 23:12
Colin Angus Mackay8-Feb-04 23:12 
GeneralRe: How to reduce size? Pin
Mazdak8-Feb-04 23:27
Mazdak8-Feb-04 23:27 
AnswerRe: How to reduce size? Pin
leppie9-Feb-04 6:55
leppie9-Feb-04 6:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.