Click here to Skip to main content
14,549,653 members

Silverlight / WPF

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder16-Jul-09 3:09
cofounderChris Maunder16-Jul-09 3:09 
PinnedHow to get an answer to your question PinPopular
Chris Maunder16-Jul-09 3:05
cofounderChris Maunder16-Jul-09 3:05 
Question2 xaml windows question Pin
Michele Smith26-May-20 7:10
MemberMichele Smith26-May-20 7:10 
AnswerRe: 2 xaml windows question Pin
#realJSOP26-May-20 7:43
mva#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
Membermichaelbarb7-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
Membermichaelbarb11-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
Memberpriyamtheone13-Apr-20 3:38 
AnswerRe: Problem in designer while creating a new window in a WPF project in Visual Studio 2010. Pin
Gerry Schmitz13-Apr-20 6:59
mveGerry Schmitz13-Apr-20 6:59 
GeneralRe: Problem in designer while creating a new window in a WPF project in Visual Studio 2010. Pin
priyamtheone14-Apr-20 1:36
Memberpriyamtheone14-Apr-20 1:36 
QuestionDP Firing Order Pin
Kevin Marois30-Mar-20 7:43
professionalKevin Marois30-Mar-20 7:43 

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.