Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In my WPF project,i need autoFilter like Excel filter, and DataGrid columns is Not fixed,because it's import in excel, i used this method add column. What method should I use? help!help!help!

What I have tried:

var column = new CustomBoundColumn();

column.IsReadOnly = false;
column.Header = cell.CellTitle;
column.Binding = new Binding(string.Format("UISKUCells[{0}]", i));
column.TemplateName = "customerDataGridTextColumnDataTemplate";
column.Width = 100;

SkusDataGrid.Columns.Add(column);
Posted
Updated 2-Jan-18 2:24am
Comments
PureNsanity 20-Dec-17 12:08pm    
Are you talking about using the filtering capabilities that Excel has? I'm not sure what adding a column has to do with filtering, but if you are talking about the rich filtering capabilities then you've got to use a third party library or build them yourself. If you need to do simple filtering based off a text box or other value, then the CollectionViewSource is the way to go.

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900