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
Hello dougiejay,
if you do not want a specific column to be visible inside the Column Chooser dialog you could use the following code to remove it from XamGrid
this.xamGrid.Columns.Remove(this.xamGrid.Columns[index]); when loading your data .
HTH, regards Nikola.
Sorry I should have explained that I still need the column for a hidden filter and therefore cant remove it, just want to hide it...
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.
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
However even this isnt ideal as the filter still shows up in the Name column. The user can either turn the filter off or they could get confused as to why the filter there at all...
If you don't need the UI portion of the Filter, why not just use LINQ to query your collection and assign the query results to the grid? This way you could avoid needing to have the filtered column all together, and it would not show up in the column chooser.
Devin
Hi Devin,
I just assumed that filtering would be faster if the user is modifying the visible list frequently.
However if you guys are using LINQ behind the scenes for the filter anyway it seems to make the most sense.
Am I correct on this point - that you are using LINQ to do the filtering? Is this also why filtering is quite slow in the grid when lots of unique values (about 900 rows in this grid)?
Currently this feature has not been implemened yet.
Hi,
is this feature available yet?
Doug,
This update is to let you know that I submitted a feature request for the ability to exclude columns from the column chooser. I have sent you specific information about that request in a private support case.
Thanks,Francis
I have created a new thread regarding the performance of the filtering at :
http://forums.infragistics.com/forums/p/47010/251659.aspx#251659
No it isnt the boolean filter that is concerning me performance wise. It is our other string based columns. If I use the UI to add a filter to a column like our Color Description column which probably has around 200 possible values and deselect all but one or two, applying the filter takes several seconds. Also, clearing the same filter takes quite some time and the CPU goes to 50% for an extended period for IE.
However looking at your official samples I can see the one with a million rows (or whatever large number it is) filters very quickly. So I need to investigate some more.