We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridFilterBar and ReadOnly tables

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? Thanks, Sam

3 Replies

AD Administrator Syncfusion Team March 30, 2004 12:29 PM UTC

In the Filterbar sample, if I set either Me.gridDataBoundGrid1.Binder.EnableEdit = false or 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.


SJ Samuel Jack April 5, 2004 07:41 AM UTC

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. Sam


AD Administrator Syncfusion Team April 5, 2004 08:17 AM UTC

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.

Loader.
Live Chat Icon For mobile
Up arrow icon