I am using the wingrid ver 2006/vol 3./clr 2 in a proj which needs to make the grid enabled/disabled based on user rights (view only) and other various requirements. Currently, the grid lives in a winform container with many other controls & enabling/diabling them all is quite simple by enabling/disabling the container.
Unfortunately, i can not get the grid to scroll when it is disabled. Is there a way to make the grid scroll so the users can view ALL the data when the grid is disabled??
NOTE: I realize that i can set the grid/cell background color, grid/cell activation, etc to make the grid appear disabled when it's actually not. But I suspect that you folks at Infragistics already have a solution/work-around to allow us to override the 'disabled scrollbars' when we disable the grid so that the users can view ALL the data & us programmers don't have to go to too much trouble.
Thanks!//bitFlinger
I'm not actually sure if this is possible, since what you are referring to is basically a ReadOnly grid while when a control is disabled it is not supposed to respond to any sort of user interaction. Is there any sort of way that you can put the non-grid controls into a different container (even a panel whose z-order is behind the grid) so that you can disable all of those controls, but then just change the appropriate Allow* properties on the grid?
-Matt
BUT, my question is; does Infragistics have a easier solution/work-around, so i don't have to do all this?
It seems to me, they have problem ran accross the request from other for a view-only gray-looking grid
//bitFlinger
I don't think there is really an easier way to do this, since a control should not respond to any user interaction when it is disabled (and indeed this is how the .NET DataGridView behaves as well). My personal preference would be to go with your second option since then you can just disable the container that the other controls are in with a single line of code instead of recursively looping through everything.
If you want the scrollbar to work, then you cannot set the Enabled property on the grid to false, you will have to do it another way. What you could do is disable all of the columns in the grid using the CellActivation property on the column. This would make the cells appear disabled, but still allow the user to scroll and even expand or collapse rows and do other things like sort of filter, without allowing them to edit.
This KB article might help you: HOWTO:How can I make a grid or a column, row, or cell in the UltraWinGrid disabled or read-only?
Yes, but Infragistics is the one which has determined how the control should look & respond when it is disabled - right? Therfore, i just thought maybe they had scrollbar override settings which could override the scrollbar functionality when it is in the disabled mode.
SO, maybe, i'm asking the wrong question...
I would like the grid to function in 2 modes:
1) the grid looks active with some cells editable/tabable & cell cells read-only/non-tabable - this part is working fine
2) the grid is all greyed out & nothing can be selected (looks/responds just like it does when it is disabled, but the scollbar works) - is there a easy way to do this?