linq - WPF DataGrid Take() not working for ItemsSource -


I am trying to tie a data grid in an array for testing purposes. Unless I'm trying to filter anything, auto columns work well.

As soon as I try filtering the array. (5) or with any other filter, the rows remain blank, and there are only things horizontal lines I think there may be something in it, with the generated "Anonymous" class. But this is a wild guess ...

Show me some code that works well, and does what he wants:

  public partial Square WindowLister: UserControl {private int counter = 0; Public Windilist () {Initialization (); DataGrid1.ItemsSource = SystemWindow.FilterToplevelWindows (FilterFunction); } Private Butle Filter Function (System Window Window) {Counter ++; If (counter> 5) return false; Back true; }}  

and now the version does not work:

  Public Partial Class Windowolister: UserControl {public WindowLister () {InitializeComponent (); DataGrid1.ItemsSource = SystemWindow.FilterToplevelWindows (FilterFunction). Take (5); } Private Butil Filter Function (System Window Window) {Back to Truth; }}  

For any interest, the source used is very good from Lib: ManagedWinapi.Windows;

Any help is appreciated ... Chris

I hope That you need a list ( LE / ou etc. You can get a IEnumerable / IQueryable & lt ; T & gt; will order). Try using . (5) .OLICI () , or . where (...). ToList () etc. (where ... is your filter).


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -