c# - WPF ListView not rendering templates -


I have ListView that I populate with the item from ObservableCollection . Everything was working well until I decided to add another list view to filter some items.

What I have now setup is the first item in the item group with the item distributed items with Item ItemGroup in the main list view. Imagine a hashtable with buckets and items in the list provided in the list are items which are the most current.

I have a button that will show another list view with all items while clicking, however, that I'm getting blank entries for the item in the new list view. I'm looking at their item styled background, but the celltaplet appears blank.

My only guess is that there is no reference issue as some items are already in another ItemSource .

I've attached a screenshot:

problem

This is my DataTemplate :

  & gt; DataTemplate x: Key = "ResultListGroupViewCellTemplate" & gt; & Lt; -! & Lt; DockPanel & gt; - & gt; & Lt; Grid width = "Auto" margin = "0,5,5,5" ShowGridLines = "False" & gt; & Lt; Grid.ColumnDefinitions & gt; & Lt; Column width = "30" /> & Lt; /Grid.ColumnDefinitions> & Lt; Grid.RowDefinitions & gt; & Lt; Roadfinition /> & Lt; /Grid.RowDefinitions> & Lt; Stackpaneel grid Column = "0" & ​​gt; & Lt; Image margin = "2" source = "{binding path = power image}" height = "20" width = "20" horizontal alignment = "left" /> & Lt; TextBlock Text = "{Binding Path = AddedDate}" margin = "0,3,0,0" TextTrimming = "CharacterEllipsis" VerticalAlignment = "Center" FontFamily = "Tahoma" FONTSIZE = "10" FontStyle = "Italic" HorizontalAlignment = " Left "/> & Lt; / StackPanel & gt; & Lt; / Grid & gt; & Lt; -! & Lt; / DockPanel & gt; - & gt; & Lt; / DataTemplate & gt;  

In this way I set up the database (the objects used to force the matching APIObjects in the DataTemplate above):

< Pre> groupViewCollection = new Observe Collection & lt; MatchApiObject & gt; (M.GroupList.OrderBy (mi = & gt; mi.AddedDate)); GroupViewListView.DataContext = groupViewCollection;

and groupViewListView only:

  & lt; ListView name = "groupViewListView" itemContainerStyle = "{StaticResource ListViewMatchItemStyleNotSelected}" SelectionMode = "single" ItemsSource = "{binding}" BorderThickness = "0" SelectionChanged = "contactsList_SelectionChanged" AlternationCount = "2" HorizontalContentAlignment = " Muscles "ScrollViewer.HorizontalScrollBarVisibility =" Disabled "& gt; & Lt; ListView.View & gt; & Lt; GridView x: name = "groupViewListViewGridView" allows CollapseReorder = "False" & gt; & Lt; GridView.ColumnHeaderContainerStyle & gt; & Lt; Style TargetType = "GridViewColumnHeader" & gt; & Lt; Setter property = "visibility" value = "collapsed" /> & Lt; / Style & gt; & Lt; /GridView.ColumnHeaderContainerStyle> & Lt; GridViewColumn CellTemplate = "{StaticResource StrengthValMatchColumnCellTemplate}" width = "0" header = "strength" /> & Lt; GridViewColumn CellTemplate = "{StaticResource DateMatchColumnCellTemplate}" width = "0" header = "date" /> & Lt; -! & Lt; GridViewColumn CellTemplateSelector = "{StaticResource myMatchListItemTemplateSelector}" width = "auto" header = "results" /> - & gt; & Lt; GridViewColumn CellTemplate = "{StaticResource ResultListGroupViewCellTemplate}" width = "auto" header = "results" /> & Lt; / GridView & gt; & Lt; /ListView.View> & Lt; / ListView & gt; Edit: When I debug, there are appropriate items in the binding in the list view (for example, CurrentItem shows the proper object that should be used for binding), but for some reason they are not showing. 

I'm stupid It looks like width = "auto" on the column all with my main data template There is no way to spread. Width = 100 Setting part shown Parents may not spread in every way.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -