I have a GridFilterBar attached to my GridDataBound control. When I set the Grid control to ReadOnly the filter bar row becomes like a blank header row. I want the Filter Bar to be enabled even when the Grid is read only. How can I do this?
ADAdministrator Syncfusion Team March 30, 2004 07:29 AM
In the Filterbar sample, if I set either
Me.gridDataBoundGrid1.Binder.EnableEdit = false
Me.gridDataBoundGrid1.TableStyle.ReadOnly = true
at the bottom of FormLoad, I do not see an empty filter row.
How are you setting your readonly property? Are you setting it before you wire the filterbar? If so, you might try calling grid.IgnoreReadOnly = true before you wire the filterbar, and then set it back false afterwards.
SJSamuel JackApril 5, 2004 03:41 AM
Setting IgnoreReadOnly to true before wiring the filter bar to the grid works (ie the filter bar is displayed properly and I can select items from its dropdown). However, I now have another problem:
Selecting an item to filter by does not work when the grid is set to read only (ie grid.Model.ReadOnly = true). The rows remain stubbornly unfiltered.
We have a requirement that in particular cases users should not be able to edit the data in the grid, only view it. However in those cases users might well want to filter the information.
Hope you can help.
ADAdministrator Syncfusion Team April 5, 2004 04:17 AM
Using this.gridDataBoundGrid1.Binder.EnableEdit= false; instead of this.gridDataBoundGrid1.Model.ReadOnly = true; allows the filter to work for me, and still makes the grid uneditable.
If you want to use ReadOnly settings, then instead of setting Model.ReadOnly, set grid.TableStyle.Readonly. Then subscribe to the grid.Model.QueryCellInfo event, and there set e.StyleRadOnly = false if e.RowIndex == 1.