Home Forums WPF controls Xceed DataGrid for WPF DataGrid within a DataGrid

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #23814 |

    I’m pretty new to WPF (3 days and counting) but not to .NET (a fair bit longer than 3 days!) so the answer to my query could very well be really simple.

    I have a custom card view that I’ve modified and and added another DataGrid below each row of data. What I would like to do is easily populate the DataGrid with information related to the parent Card.

    Scenario:
    I have a table of Employees and a table of Equipment with the common key being EmployeeID. I will display 3 rows at a time from the Employee table and would like the datagrid of each card to be populated automatically with the Equipment that has been borrowed by them.

    How could I go about this? Even if it can’t be done automatically but can be done by code that flicks from all the datarow returned from the Employees, retrieves the equipment and then sends it to the child DataGrids it would be appreciated.

    Another, slightly related query, I can seem to get rid of the Grouping header that appears on top of the DataGrid. I’m sure I’m overlooking an option or two somewhere.

    Finally, is there a way to have the DatePicker display the same way the Windows.Forms Calendar displays? (i.e. always visible, without a field displaying the date, etc.)

    I will appreciate any help!

    Imported from legacy forums. Posted by Kawsar (had 625 views)

    User (Old forums)
    Member
    Post count: 23064

    I guess that what I’m asking for isn’t possible…

    Imported from legacy forums. Posted by Kawsar (had 472 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi,
    I would like to do the same thing you are describing here.
    Please let me know if you found an easy way to do it.

    Thnak you,
    Ido.

    Imported from legacy forums. Posted by Ido (had 3027 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi,

    Looking for exactly the same thing!

    Can anyone please help?!

     Thanks!

     

    Imported from legacy forums. Posted by Vibhas (had 210 views)

    Xceed Support
    Member
    Post count: 5658

    If I understand correctly, you want to display a master detail relation using CardView. This is not built-in and I would suggest you use TableView or TableflowView to achieve such data to get the best performance and the less code possible.

    If you really want a CardView, one way to do would be:

    1 – Define an UnboundDataGridItemProperty  in your DataSource that will compute the DetailSource according to the master ID column in the business object

    2 –  Redefine the ControlTemplate of the DataRow to include the detail DataGrid at the desired location

    3 – Bind the ItemsSource of the detail DataGridControl to the value of the Cell mapping the UnboundDataGridItemProperty created in 1

     

    But as I said earlier, to get the best of master detail, you should use the TableView or TableflowView that were designed to embed and support the master detail feature.

     ##### 

    Have a look at the CardView sample for the GroupByControl visibility.

     #####

    DatePicker : You can set the CellEditorDisplayCondition to Always on the Column to always display the CellEditor (DatePicker)

    Imported from legacy forums. Posted by Chris [Xceed] (had 688 views)

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.