-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DataGrid styling #30
Conversation
Looks good to me so far. Glad you are joining the project :) Just one thing: Is there a reason why you changed some line breaks in the existing ListView styles? Or was this accidently caused by an auto-formatter maybe? |
Ah, I didn't intend to commit these changes. I added linebreaks to see all text without horizontal scrolling. I'm working on the PR with additional windows open to compare sources (MS docs, Adonis ListView, etc.) There are certainly some things I didn't understand at first, but I'm getting there. At the moment I'm guessing that there are implicit features between certain types that break without retaining the invariants. Tough to pinpoint exactly. |
Is there a way to enable cooperation for this PR? |
You can make PRs editable for project maintainers. But maybe you have already. I don't know how to find out if I can edit it other than simply trying to make changes. |
Apparantly this was already enabled by default? Anyway, it says users with write access to this repo are allowed to push commits to my PR branch, which is master on my fork. |
- Allows for live view updates on XAML change
Hey, |
Hi, |
# Conflicts: # AdonisUI.ClassicTheme/AdonisUI.ClassicTheme.csproj
finally I have time to really look into this. Sorry again it took me so long. What I have done now:
I am not sure what is missing though. Seems like you were unsure about the validation templates so I will look into that. There is also some kind of edit mode for cells that should be checked I think. The row header looks good to me. What do you think is missing there (it is marked as todo currently). |
Hi, Bert |
…w is still selected but lost focus
Ok, so I looked at the code and it already looks good. Following are points to improve the styling even further:
I tried to fix point 1 but the SelectiveScrollingGrid must always be on top, which puts the grid border on top. I only recently discovered Grid.SharedSizeGroup and haven't done much with it yet, but I might be able to integrate this. |
Horizontal grippers are currently not present (code commented out). I've never used it myself and am not sure it's that valuable to implement? |
The grippers are fine in my opinion. And the 'select all rows' button does not grow anymore, I did not notice this behavior at first. I see what you mean considering the misclicks on row selection. I did not find a way to do it any better by now. Seems like we have to decide if we want to trade a better look for better usability. |
Maybe negative margin on mouse-over layer is an option? I'll look into that tomorrow. |
The negative margin looks good. But I realized that omitting the border completely looks even better in my opinion. You can try it by setting You are right, the padding should not necessarily depend on the border thickness. The virtualization issue worries me a bit. I will try to reproduce it on my machine. PS: Yeah, that control is more complex than I thought as well. But you are doing great! I'm glad you are helping. |
You're right, without the padding it looks good as well. So I was experimenting with GroupStyles and a way for Adonis to have some helpers or preset styles, but group styles is an observable collection on datagrid. There doesn't seem a way to fully style the container or header template, so this falls on the shoulders of the dev. Next, I wanted to check if the primitive controls inside the group style are getting adonis styles applied but there is a crash regarding cells and the grid scroll host. It seems the group style I applied somehow detached the parent-child relationship between the scroll host and grid cells. |
Debugging this is a bit above my head. I have a setup with dotpeek pdb generation and i can mostly understand what the specific method is supposed to do. The tough part is understanding why the scrollhost of the parent datagrid changes between default and adonis. |
I cannot say what exactly causes the crash but I just noticed that it does not occur when you swap the expander header with the expander content. If I replace the expander with a grid, it works as well. So it might be an issue with the expander's control template, actually. |
I'd like to say that I've racked up enough experience with WPF to fix these issues, but I cannot. Literally no further progress was made on my side. |
I feel a little demotivated with this one, too. I found out that it definitely has something to do with the So, the only possible solution that comes to my mind is to create a separate expander style only for this case which does not have the |
I don't think having a specific expander style for Datagrid children can be enforced. The programmer is free to design the group style into whatever he wants. About this PR, I'm leaving the decision up to you what to do with the code. You're free to merge or not. |
You're right, we could only offer such a style and document when to use it. I think you achieved a lot here still. It is definitely worth merging. Thanks a lot for all your efforts. And sorry that I was not able to solve the remaining issues as well. I hope it serves your own use case enough so you can use it in your project. May this little unsatisfying end not be the end of all cooperation :) |
…en virtualization is active
Just for future reference: Even after spending multiple hours with the data grid I wasn't able to resolve the remaining virtualization issue completely. Conditions required for the issue to occur:
Expected behavior:
Result:
What I did now is to set the visibility of the error icon of each row to Still, when the validation error is gone, the row headers are expected to shrink again. But instead, again, only some row headers shrink and other do not. Because I was not able to fix this, I implemented a workaround here by making the icon visibility stay on Remember that the issue only occurs if row virtualization is enabled. |
closes #29 |
As discussed in #29, I'm attempting to style the DataGrid control.
The intention is to style the following parts of the DataGrid control;
DataGrid row groups (recursively)This is hard, I'm learning WPF while doing so it might take a while until this task completes. Feedback and help are welcomed!
Bert