Click here to Skip to main content
15,900,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi A bit new to MVC but getting there:)

I have a base model

C#
public class FgtDataEntryBaseModel
{
    public long FgtDivisionId { get; set; }
    public long FgtDepartmentId { get; set; }
}


I wish to add additional fields to this I assume via 'View Model' depending on what the user selects at login.. The number of FgtCtrActxxx fields can vary from 1-999

C#
public class FgtDataEntryNewViewModel
{
    public long FgtDivisionId { get; set; }
    public long FgtDepartmentId { get; set; }
    public long FgtCtrAct1 { get; set; }
    public long FgtCtrAct2 { get; set; }
    public long FgtCtrActxxx { get; set; }


I would then file the 'view model' with the relevant data and bind the list to the grid..

I hope I have explained myself enough here?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900