Giter Site home page Giter Site logo

Comments (6)

benruehl avatar benruehl commented on May 16, 2024

Got it reproduced now, thanks for reporting.
This seems to occur in case the GridView.Columns are not specified.
I will add a null check at least and see whether it makes sense to collapse.

from adonis-ui.

benruehl avatar benruehl commented on May 16, 2024

May I ask what your use case for this setup is? Using a ListView but not specifying any columns sounds to me like a ListBox is what you really want.

from adonis-ui.

dennis-benson avatar dennis-benson commented on May 16, 2024

I was reporting the bug based on the demo.

In my project, I was specifying columns in a ListView

<GridView>
    <GridViewColumn Header="Name">
          ...
     </GridViewColumn>
     <GridViewColumn Header="Age">
           ...
      </GridViewColumn>
</GridView>

It seems to be a problem only when HorizontalOptions is set to stretch - which I suppose WPF doesn't like

from adonis-ui.

benruehl avatar benruehl commented on May 16, 2024

I am not quite sure what you mean. I do not get any exception in the demo when clicking on a GridViewHeader so it would be helpful if you could explain it a bit further.

In which exact scenario do you get an exception? Is the code you posted causing errors or is this working code? And what do you mean with "when HorizontalOptions is set to stretch"? Do you mean HorizontalAlignment? And if so, where do you set it to Stretch?

In order to fix it, I need to reproduce it. I indeed got errors when there are no columns defined. And that is what i have fixed. If you still get errors because you mean a different scenario please tell me what I have to do in order to get the errors as well.

from adonis-ui.

dennis-benson avatar dennis-benson commented on May 16, 2024

Sorry, I thought it'd be easy to reproduce :)

If the columns don't fill all the available space, a "clickable phantom header" is visible (see screenshot and xaml) - clicking it produces a crash.

crasher

                         <TabItem Header="Grid View">
                            <ListView ItemsSource="{Binding Items}">
                                <ListView.View>
                                    <GridView>
                                        <GridView.Columns>
                                            <GridViewColumn Header="Name" DisplayMemberBinding="{Binding Name}"/>
                                            <GridViewColumn Header="Weight"
                                                    DisplayMemberBinding="{Binding Weight, StringFormat=N2}"/>
                                        </GridView.Columns>
                                    </GridView>
                                </ListView.View>
                            </ListView>
                        </TabItem>

It appears that the phantom header is extends from "Name" to the edge of the container. The best way to hide it is by adjusting the column width to fill space, or adjusting the listview width to fit the columns.

from adonis-ui.

benruehl avatar benruehl commented on May 16, 2024

Thank you for taking the time to add some details.
Now it makes sense to me what you meant with "empty space". I did not really get that before although it seems quite obvious now.
But I am glad that the null check fixes that already, even though it targeted a different case :)

Stretching the columns to eliminate the empty space is not possible with simple XAML as far as I know. Maybe I could build another extension for that in a future version if you would like to see this.

from adonis-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.