Q: How can I programatically add columns with filter?
See original GitHub issueHi! This project is great! Thanks a lot!
I have a question though. I’m using DataGridFilter in conjunction with BindableColumns from this post on StackOverflow to be able to add columns dynamically when utilizing MVVM. This means I’m adding columns programaticaly (in the ViewModel) like this:
public ObservableCollection<DataGridColumn> Columns { get; set; }
...
Columns.Add(new FilterDataGrid.DataGridTextColumn()
{
Header = "Name",
IsColumnFiltered = true,
Binding = new Binding() {...},
HeaderTemplate = ???,
});
I guess I have to fetch the HeaderTemplate, but is that possible from a viewmodel? Can I add a reference to the DataGridHeaderTemplate resource in my application resources somehow maybe?
Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
JQuery Tablesorter Add Column with Filters
I have seen this question: Adding columns dynamically to a table managed with jQuery's tablesorter - which recommends that I remove and recreate ......
Read more >Dynamically Add Columns using Filter
Suppose you have 20 columns in a sheet & you want to add specific number of columns based on the selection in the...
Read more >Solved: Dynamically Add Columns, Filter Excel Dataset and
Dynamically Add Columns, Filter Excel Dataset and Group By in Datatable ... You can collect this or use it in a gallery filter....
Read more >How to set filters to column programmatically? in UI for WPF
Hi, Attach to RadGridView's AutoGeneratingColumn event and then in the event handler you will have e.Column.ColumnFilterDescriptor which is used ...
Read more >[OutSystems Data Grid] Programmatically Add Filters to ...
Hello, first of all this component is very useful! Thank you for putting this together. Is it possible to apply filters to the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
hmm, that’s true. I’ll have to think about this. There must be a way. I’m surely not the first person to have this need…
Yes, but you will have to do it yourself. On the other hand I’m not sure if it works, by adding the columns as you want to do it, the ItemsSource property will not be filled, the added columns will be detached from this property, as if they were isolated from all the mechanics internal to the datagrid.