Display my form data as read-only

Posts   
 
    
Markiemac
User
Posts: 132
Joined: 25-Apr-2006
# Posted on: 19-Jan-2009 23:00:42   

Hi, (Using Adapter 2.5 & VB 2005 in a distributed WinForm app Hosted in IIS)

I have many forms within the app, most of which are complex multi-tabbed forms. Not all users have update access to the forms, so what is the easiest way of presenting the form data as read-only?

I'm thinking that the solution may involve the datasource, but ...

Thanks

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 20-Jan-2009 06:34:26   

Hi Markiemac,

What about this?

protected Load()
{
     userCanUpdate = CanUserUpdateThis(userId);
     this.theGrid.AllowUpdate = false;
     this.saveButton.Enable = false;
     // etc ...
}

I know this is very vague, but I don't know what are you really looking for.

David Elizondo | LLBLGen Support Team
Markiemac
User
Posts: 132
Joined: 25-Apr-2006
# Posted on: 21-Jan-2009 13:50:52   

daelmo wrote:

Hi Markiemac,

What about this?

protected Load()
{
     userCanUpdate = CanUserUpdateThis(userId);
     this.theGrid.AllowUpdate = false;
     this.saveButton.Enable = false;
     // etc ...
}

I know this is very vague, but I don't know what are you really looking for.

This is helpful as I was interested to know if there was a silver bullet at the form level. Since there isn't I'm thinking of the following:

  1. For my simple reference data forms, as above.

  2. For the complex forms (many tabs, many many other controls) allow the form to be edited, but don't allow it to be saved.

So: Disable Save & Delete buttons If the Datasource is dirty, do not allow Saving On form close, just close the form.

Are there any other strategies that might do?

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 21-Jan-2009 16:24:06   

Would you please check the Authorization example for Winforms , available in the downloads section of the our web-site.