Click here to Skip to main content
16,020,673 members
Home / Discussions / WPF
   

WPF

 
QuestionBehavior/DP Question Pin
Kevin Marois22-Jun-20 8:27
professionalKevin Marois22-Jun-20 8:27 
AnswerRe: Behavior/DP Question Pin
Richard Deeming23-Jun-20 4:44
mveRichard Deeming23-Jun-20 4:44 
GeneralRe: Behavior/DP Question Pin
Kevin Marois1-Jul-20 8:30
professionalKevin Marois1-Jul-20 8:30 
GeneralRe: Behavior/DP Question Pin
Richard Deeming1-Jul-20 23:32
mveRichard Deeming1-Jul-20 23:32 
GeneralRe: Behavior/DP Question Pin
Kevin Marois2-Jul-20 8:49
professionalKevin Marois2-Jul-20 8:49 
Question2 xaml windows question Pin
Michele Smith26-May-20 7:10
Michele Smith26-May-20 7:10 
AnswerRe: 2 xaml windows question Pin
#realJSOP26-May-20 7:43
professional#realJSOP26-May-20 7:43 
QuestionCreate DataGrid From List<T> With Properties As Columns Pin
Kevin Marois18-May-20 7:14
professionalKevin Marois18-May-20 7:14 
I have a bit of a challenge here.

I'm working on an app that manages home building projects. A house can have floors, and this is a BuildingTypeEntity. Examples are "1 Story", "2 Story", etc. Parts, supplies, and equipment are delivered to the job site periodcally. Generally every few days. These deliveries are called "Schedule Packs", and that's represented by the SchedulePackEntity

These two entities are shown below:
public class BuildingTypeEntity : _EntityBase
{
    private string _Caption;
    public string Caption
    {
        get { return _Caption; }
        set
        {
            SetProperty<string>("Caption", ref _Caption, value);
        }
    }
    private int _NumberOfFloors;
    public int NumberOfFloors
    {
        get { return _NumberOfFloors; }
        set
        {
            SetProperty<int>("NumberOfFloors", ref _NumberOfFloors, value);
        }
    }
    private ObservableCollection<SchedulePackEntity> _SchedulePacks;
    public ObservableCollection<SchedulePackEntity> SchedulePacks
    {
        get { return _SchedulePacks; }
        set
        {
            if (_SchedulePacks != value)
            {
                _SchedulePacks = value;
                RaisePropertyChanged("SchedulePacks");
            }
        }
    }
}

public class SchedulePackEntity : _EntityBase
{
    private int _BuildingTypeId;
    public int BuildingTypeId
    {
        get { return _BuildingTypeId; }
        set
        {
            if (_BuildingTypeId != value)
            {
                _BuildingTypeId = value;
                RaisePropertyChanged("BuildingTypeId");
            }
        }
    }
    private string _Caption;
    public string Caption
    {
        get { return _Caption; }
        set
        {
            if (_Caption != value)
            {
                _Caption = value;
                RaisePropertyChanged("Caption");
            }
        }
    }
    private int _Sequence;
    public int Sequence
    {
        get { return _Sequence; }
        set
        {
            if (_Sequence != value)
            {
                _Sequence = value;
                RaisePropertyChanged("Sequence");
            }
        }
    }
    private int _Floor;
    public int Floor
    {
        get { return _Floor; }
        set
        {
            if (_Floor != value)
            {
                _Floor = value;
                RaisePropertyChanged("Floor");
            }
        }
    }
    private int _Days;
    public int Days
    {
    get { return _Days; }
    set
    {
        if (_Days != value)
        {
        _Days = value;
        RaisePropertyChanged("Days");
        }
    }
    }
}
The

Packs has a property called Days, which is the number of days past the project start date when the delivery will be made.

Ok, now the problem:

There is one part of the UI where the user can select which Packs they need for a project. Then, the pack data needs to become a "horizontal version" of the data represented as a DataGrid. Please see this screenshot.

On the left side is a list of Building Types built as Expanders with DataGrids inside. This part works fine.

The right side is what I need to build. Notice that there are expanders, and in each are one DataGrid for each floor. So on the right side, under 2 Story, are 1st Floor with its selected packs as columns of a grid, and next to that is 2nd Story with its selected packs as columns of a grid. There needs to be one grid for each floor, arranged horizontally. Only the packs that are checked on the left side should appear as columns in their respective DataGrids on the right side.

The summary of the problem is how to turn a vertical list of classes, 1 to however many there are in the list, to a DataGrid with those ojects as columns.

I'm open to suggestion on a different approach, or if someone has done this, I'd like to hear how.

Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.

AnswerRe: Create DataGrid From List<T> With Properties As Columns Pin
Richard Deeming18-May-20 8:47
mveRichard Deeming18-May-20 8:47 
GeneralRe: Create DataGrid From List<T> With Properties As Columns Pin
Kevin Marois18-May-20 8:52
professionalKevin Marois18-May-20 8:52 
QuestionWPF ListBox Pin
michaelbarb7-May-20 10:03
michaelbarb7-May-20 10:03 
AnswerRe: WPF ListBox Pin
Richard Deeming10-May-20 21:52
mveRichard Deeming10-May-20 21:52 
GeneralRe: WPF ListBox Pin
michaelbarb11-May-20 19:11
michaelbarb11-May-20 19:11 
GeneralRe: WPF ListBox Pin
Mycroft Holmes11-May-20 21:33
professionalMycroft Holmes11-May-20 21:33 
AnswerRe: WPF ListBox Pin
Gerry Schmitz11-May-20 12:42
mveGerry Schmitz11-May-20 12:42 
QuestionDesign Question Pin
Kevin Marois18-Apr-20 15:26
professionalKevin Marois18-Apr-20 15:26 
AnswerRe: Design Question Pin
Mycroft Holmes19-Apr-20 12:20
professionalMycroft Holmes19-Apr-20 12:20 
GeneralRe: Design Question Pin
Kevin Marois19-Apr-20 14:09
professionalKevin Marois19-Apr-20 14:09 
GeneralRe: Design Question Pin
Mycroft Holmes20-Apr-20 12:20
professionalMycroft Holmes20-Apr-20 12:20 
QuestionMVVM: DataGrid Cell BeginEdit Pin
Kevin Marois13-Apr-20 9:10
professionalKevin Marois13-Apr-20 9:10 
AnswerRe: MVVM: DataGrid Cell BeginEdit Pin
Richard Deeming14-Apr-20 0:36
mveRichard Deeming14-Apr-20 0:36 
GeneralRe: MVVM: DataGrid Cell BeginEdit Pin
Kevin Marois14-Apr-20 6:15
professionalKevin Marois14-Apr-20 6:15 
GeneralRe: MVVM: DataGrid Cell BeginEdit Pin
Richard Deeming14-Apr-20 6:28
mveRichard Deeming14-Apr-20 6:28 
GeneralRe: MVVM: DataGrid Cell BeginEdit Pin
Kevin Marois14-Apr-20 6:39
professionalKevin Marois14-Apr-20 6:39 
QuestionProblem in designer while creating a new window in a WPF project in Visual Studio 2010. Pin
priyamtheone13-Apr-20 3:38
priyamtheone13-Apr-20 3:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.