ReadWriteAuthorization and DataGridView

ReadWriteAuthorization and DataGridView

Old forum URL: forums.lhotka.net/forums/t/3524.aspx


dcleven posted on Wednesday, September 12, 2007

I just discovered/tried the ReadWriteAuthorization component. I have it working for general controls on a Windows Form, but cannot get it working with a DataGridView. I traced through the call to ResetControlAuthorization() and what I see is in the ApplyAuthorizationRules(control) method it looks at control.DataBindings value. Now my DataGridView is initialized with DataSource = BindingSource, and when I examine the DataGridView in the debugger I see that DataBindings.Count = 0, but the DataSource does have a Count = 2 which I assume is what my grid is using.

So is ReadWriteAuthorization supposed to work with a DataGridView? And if so how can it with the DataBindings empty but DataSource not empty. My grid has been working fine for all other purposes for quite some time now.

Thanks,

Doug

ajj3085 replied on Thursday, September 13, 2007

RWAuth doesn't work with grids.  You'll have to code up relevent security yourself, using the various grid events to hide data in the column, etc.

Copyright (c) Marimer LLC