Is there a way to stop a specific column from appearing in the column chooser?
I have a hidden column that I dont ever want the user to see so I can hide the column easily enough but they can show it using the column chooser.
Thanks,Doug
Thanks. Your sample seemed a little corrupted, but made me look at this http://blogs.infragistics.com/blogs/kiril_matev/archive/2010/07/12/using-multi-column-filtering-in-the-xamgrid.aspx and I think this works pretty much as is.
Regards,Doug
You could probably do it like this with similar results
Assuming :
DataObject like this
public class MyObj
{
public string Name { get; set; }
public int ID { get; set; }
public bool Visible { get; set; }
}
Create a custom filter operand (http://forums.infragistics.com/forums/p/46336/249643.aspx#249643)
Now since we don't want it visible we will just add it to any of the available row filters collection for the rows we do want to see
(in page loaded)
myGrid.FilteringSettings.FilteringScope = FilteringScope.ColumnLayout;
RowsFilter rf = new RowsFilter(typeof(MyObj), myGrid.Columns.DataColumns["Name"]);
myGrid.FilteringSettings.RowFiltersCollection.Add(rf);
rf.Conditions.Add(new CustomComparisonCondition() { Expression = new MyFilterOperand().FilteringBLOCKED EXPRESSION
System.Linq.Expressions.Expression<Func<MyObj, bool>> expr = myobj => myobj != null && myobj.Visible;
return expr;
The custom operand will act against the whole data object, so we can write the expression against the data object and see your visible property. In this case we placed it in the name column's filters.
Hi Darrell,
Basically I have a boolean property called Visible of a Product object which is the source for each row in the grid. I set the Visible property via another control to false when we want to hide the rows from the grid for all Products that have Visible = false set. So I used a column filter to quickly hide those rows and then when visible=true they become visible again via the filter.
Does that make sense?
Doug
How are you using the column for filtering? You mighht be able to use the filtering api to inject the filters in to your grid without the column being there.
Could you explain the usage a little?
Currently there is no way to have a column excluded from the ColumnChooser. You could set the IsHideable property of the hidden column to false. It would still be in the list but should no longer be modifiable by the user.
I will ask that our DS staff puts in a feature request for feature to have a column setting to exclude it from the list.