View Issue Details

IDProjectCategoryView StatusLast Update
0004232NoesisGUIStudiopublic2025-06-11 13:16
Reporterrelacad Assigned Tosfernandez  
PrioritynormalSeverityminor 
Status resolvedResolutionfixed 
Product VersionStudio_Beta 
Target VersionStudio_BetaFixed in VersionStudio_Beta 
Summary0004232: GridView Not Building Proper xaml binding for headers. Failing to update with changes to ViewModel Data Structures.
Description

Problem: GridView when selected, creates a <GridView/> tag that does not update with changes to data binding, making it impossible to display a GridView of Items from ItemSource without manually modifying .xaml file.

  • GridView tag in .xaml will default to <Gridview/> when the View is changed from "None" with both new ListView items and ListView items that were originally GridView (and working) then changed to "None" (tested in sample code provided by Sfernandez).
  • The functioning sample of the GridView tag will not update header bindings when ItemSource of ListView binding was unbound and rebound
  • The functioning sample of the GridView tag will not update header bindings when ItemSource of the ListView data structure changed to add new data columns, including when unbound and rebound.
  • Selecting the GridView View property within source project (not the sample) would only ever produce <GridView/> in .MainPage.xaml,
  • Listview templates created with GridView View property selected would not include GridViewRowHeaderPresenter, and when added manually to template, would not show column headers as the collection was empty in the <GridView/> tag.

Originally posted about it on Studio Forum:

I found out that when I rebuilt the exact same data-template from scratch in my other project, the listview, unfortunately never displayed as a GridView, even though the option is selected. I think there is something funky going on between the studio assignment of gridview and the instance of it.

Looking at the XAML for the default GridView configuration from your project:

<ListView Height="300" HorizontalAlignment="Center" VerticalAlignment="Center" Width="500" ItemsSource="{Binding Path=Table}">
      <ListView.View>
        <GridView>
          <GridViewColumn Header="Name" DisplayMemberBinding="{Binding Path=Name}" Width="150"/>
          <GridViewColumn DisplayMemberBinding="{Binding Path=Format}" Header="Format" Width="80"/>
          <GridViewColumn DisplayMemberBinding="{Binding Path=Count}" Header="Count" Width="80"/>
        </GridView>
      </ListView.View>
    </ListView>

Vs the one in my project when I create a ListView and set it to GridView via the View Property I get the following code:

<ListView Height="100" ItemsSource="{Binding Path=Table}">
                  <ListView.View>
                    <GridView/>
                  </ListView.View>
                </ListView>

The other thing I noticed is when I go to your original project and change the ListView View type to "none", and then back to "GridView" via the properties panel the XAML changes to produce the same <GridView/> that produces no GridView column binding:

<ListView Height="300" HorizontalAlignment="Center" VerticalAlignment="Center" Width="500" ItemsSource="{Binding Path=Table}">
      <ListView.View>
        <GridView/>
      </ListView.View>
    </ListView>

I tested adding custom templates with headers, and more. Unforunately the only way I could get the GridView to behave as described in my source project was replacing the <GridView/> with the functioning sample code directly in the MainPage.xaml . Is this working as intended or have I encountered a bug?

PlatformAny

Activities

sfernandez

sfernandez

2025-06-09 14:28

manager   ~0010801

The GridView has a property named Columns that yoou need to manually populate with the desired columns. In my project I created 3 columns and manually set for each one of them the Header and the DisplayMemberBinding (by typing in the Path edit box the name of the view model property I want to assign to each column).

As I explained in the forums there is no way to automagically generate the GridView columns from a view model. Only the rows are auto generated when ListView.ItemsSource is assigned to a collection.

Hope this clarifies what I meant.

relacad

relacad

2025-06-10 00:24

reporter   ~0010806

Hey Sfernandez,

Thanks much for helping clarify this. I figured out how to actually get it working and populate the ListView with data as described, but not entirely in studio.

At the ListView View.GridView level, it was impossible to directly define columns for me. I could add a column to ColumnCollection, but these would not create an automatic binding with the ListView.ItemsSource. It took me awhile to realize that the columns inside of the <GridViewColumnCollection> in the .xaml wouldn't work for the binding for the ListView, not sure why.

So to make it work I had to go into the .xaml of the page and remove the <GridViewColumnCollection> tags around the columns I created in Studio in order to match the code you had in your sample, where the columns were not within the ...ColumnCollection Tag.

I think that's why it was hard for me to see how you defined your columns, because in the Studio ui I couldn't see the definitions, it showed up as "none" for ColumnCollection, I had to find them in the .xaml (image for reference).

I might be blind and the columns are easily accessible in UI somewhere else, avoiding this whole manual .xaml tweak, or it be a feature/bug to have the columns defined in this way. In any case I'm happy to say I got my desired feature working thanks to a small tweak in VScode, and can now complete the designs I was trying to accomplish.

columncollection empty.png (123,614 bytes)   
columncollection empty.png (123,614 bytes)   
sfernandez

sfernandez

2025-06-10 10:35

manager   ~0010808

Perhaps you were using an older version of Studio, try downloading 0.1.224.

Then select the ListView control itself (not inside its template or the item container template), and assign a GridView to the View property.
It will expand and show the following GridView properties (the one you want to manually fill is Columns).

GridView.Columns.png (117,534 bytes)   
GridView.Columns.png (117,534 bytes)   
relacad

relacad

2025-06-10 18:54

reporter   ~0010809

Last edited: 2025-06-10 18:54

Hey Sfernandez,

Updating to .224 did the trick! Thanks! On that note, it would be great if the launcher could indicate if a newer version is available!

Cheers!

sfernandez

sfernandez

2025-06-11 13:16

manager   ~0010811

| it would be great if the launcher could indicate if a newer version is available
It is in our future plans :)

Issue History

Date Modified Username Field Change
2025-06-06 18:22 relacad New Issue
2025-06-09 13:55 jsantos Description Updated
2025-06-09 13:55 jsantos Assigned To => sfernandez
2025-06-09 13:55 jsantos Status new => assigned
2025-06-09 13:55 jsantos Target Version => Studio_Beta
2025-06-09 14:28 sfernandez Status assigned => feedback
2025-06-09 14:28 sfernandez Note Added: 0010801
2025-06-10 00:24 relacad Note Added: 0010806
2025-06-10 00:24 relacad File Added: GridViewHeaderItem No Column binding visible.png
2025-06-10 00:24 relacad File Added: columncollection empty.png
2025-06-10 00:24 relacad Status feedback => assigned
2025-06-10 10:35 sfernandez Note Added: 0010808
2025-06-10 10:35 sfernandez File Added: GridView.Columns.png
2025-06-10 10:35 sfernandez Status assigned => feedback
2025-06-10 18:54 relacad Note Added: 0010809
2025-06-10 18:54 relacad Status feedback => assigned
2025-06-10 18:54 relacad Note Edited: 0010809
2025-06-11 13:16 sfernandez Note Added: 0010811
2025-06-11 13:16 sfernandez Status assigned => resolved
2025-06-11 13:16 sfernandez Resolution open => fixed
2025-06-11 13:16 sfernandez Fixed in Version => Studio_Beta