Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
User Security Setup seems to overwrite ReadOnly -propert
Message
From
01/04/2004 07:22:44
 
 
To
31/03/2004 18:50:55
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00890596
Message ID:
00891425
Views:
26
>>Another unrelated question: Grid security applies for the whole grid, right? There is no easy way to set security at the grid column >>level, is there?

Do you want to have security for an entire column or individual rows of a specific column. I recently had to secure a column in a grid that contained a hyperlink. The entire column of hyperlinks was either enabled or not as per security. If this is what you need I will go back and dig up the code. It involves creating a hyperlink templatecolumn and then setting attributes for the column depending on security settings. Next week I will actually be working on a grid that needs to have specific rows of a column secured. If this is what you need I could share that also. Talk to you soon. BTW I use role-based security exclusively. I have not done this for user-based security.

Regards,
Neil


>>Pertti,
>>
>>>Another option I tried is use Enabled instead of ReadOnly. The problem with this (as far as I can tell) is that with Web apps Enabled makes it difficult if not impossible to iterate through the controls that are currently disabled, because they do not show up in the Request.Form.AllKeys -array, which I use to do the looping. If there is another way to loop through all controls on a web form regardless of their Enabled -status, I would be quite happy to use that with Enabled on/off (I tried to figure it out but could not make it happen for some reason...). I guess this would also avoid the whole issue on what is readonly and what is not.
>>
>>You should be able to iterate through all the controls by doing something like this:
>>
>>
public void GetObjects(Control Container)
>>{
>>	// *** Drill through each control on the form
>>	foreach( Control control in Container.Controls)
>>	{
>>		// ** Recursively call down into any containers
>>		if (control.Controls.Count > 0)
>>			GetObjects(control);
>>
>>		// ** Do your processing here!
>>	}
>>}
>
>I tried this approach already, but I got the following compile error:
>'System.ComponentModel.Container' does not contain a definition for 'Controls'
>
>Which is no surprise, really, since Intellisense only shows "Equals" and "ReferenceEquals" as available options for the Container -control on the web form.
>
>
>>
>>>Another unrelated question: Grid security applies for the whole grid, right? There is no easy way to set security at the grid column level, is there?
>>
>>That's right...I talked about this again with Rick and he prefers not to use grids for data entry on the web.
>
>Allrightie, then. I can see many reasons for this preference, but since you provide Edit functionality within grids as part of MM.NET, it would stand to creon that you would be able to apply security on column level.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform