Coder Social home page Coder Social logo

Styling DataGrid about adonis-ui HOT 3 CLOSED

Bert-Proesmans avatar Bert-Proesmans commented on August 15, 2024
Styling DataGrid

from adonis-ui.

Comments (3)

benruehl avatar benruehl commented on August 15, 2024 1

There is no particular reason that there is no default style for DataGrid included in AdonisUI. Honestly, I kind of forgot that this control even exists and no one asked for it until now.

I don't think that it would be harder to style it than any other control. I would start with an official template from the Microsoft docs that hopefully has everything on board (I also had the opposite case in the past). This shows the different styles that have to be considered and might show important properties that should be taken into account.
Then I would replace the style contents step by step with the ones from the AdonisUI's list view style. Most styles can be matched I think, so that ListViewItem becomes DataGridRow etc. But be careful when replacing the styles as one easily removes things like setters, bindings or triggers which then leads to properties having no effect. There might be some things that cannot be matched easily like the style for DataGridCell which does not exist for list view. You might be able to re-use parts of the row style for that one.
Put the whole style collection in a ResourceDictionary file and reference it in your App.xaml.

Note that the styles from Microsoft use VisualStateManagers. Those are a convenient way of defining different appearances depending on the visual state, in case you didn't know already. AdonisUI does that using DataTriggers instead, because they support complex conditions which is required for the layering system. So it's fine to just remove all of those.

Hope this helps. Don't hesitate in case you have further questions.
You can leave this issue open so that it reminds me to create the style myself someday in case you have no time to contribute it.

PS: I have never heard or read that the DataGrid should be avoided or anything. But I agree that it is less popular than the list view. Maybe it is because it was added later to WPF when everyone had already committed themselves to list view?!

from adonis-ui.

Bert-Proesmans avatar Bert-Proesmans commented on August 15, 2024

Hi, thanks for the quick reply and the concrete pointers. I'm certainly gonna look into it! Thank you

from adonis-ui.

benruehl avatar benruehl commented on August 15, 2024

closed by #30

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.