mauriziopatino
WPF DataGrid on CustomControl
Hi, I need some help in WPF/XAML
I have a UserControl for a PaginatesTable where I have a couple of WPF controls inside, TextBox, DataGrid, and some buttons for pagination, the main idea of the UserControl is to be reusable, so basically I have some PaginatedTableViewModel<T> which I initialize on each ViewModel of the Views and then I pass an ObservableCollection into PaginatedTableViewModel<T> to render those Objects
But I need an approach to customize the DataGrid columns, Because obviously there are different properties on <T>
Probably I want to do something like
<PaginatedTable DataContext={Binding PaginatedTableViewModel}>
<PaginatedTable.Columns>
<!-- Customization of Columns —>
</PaginatedTable.Columns>
</PaginatedTable>
I tried with DependencyProperty but I was not able tu make it reusable
2 replies
ASP.NET Don't clean form after error validation
Hi, i have a GET method called Create() where just display the Create View
public IActionResult Create()
and a POST method called Store() where just store all the values from Create view form
public async Task<IActionResult> Store(ViewModel vm)
How can I return a Redirect to "Create" View without loosing form data after Fluent Validation error?
All is working correctly, the problem is that when I returned to my "Create" view I loose all the form information3 replies
❔ Entity Framework 7 model property as enum is giving conflicts when running migration
I'm trying to create a many to many "pivot" model where it haves 2 fields "GroupId" and "SubscriptionId"
I have a SubscriptionType enum:
When i run the migration it gives me this warnings:
"The foreign key property 'GroupSubscription.SubscriptionId1' was created in shadow state because a conflicting property with the simple name 'SubscriptionId' exists in the entity type, but is either not mapped, is already used for another relationship, or is incompatible with the associated primary key type. See https://aka.ms/efcore-relationships for information on mapping relationships in EF Core."
19 replies