Home Forums WPF controls Xceed DataGrid for WPF CustomView Sample and horizontal card view

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

    I am looking at your CustomView sample specifically looking at the Custom Card View. I would like to know if the cards can organized horizontally instead of vertically. I have played around with the code for a bit, but I can’t seem to find where this would be done.

    Thanks for your time,
    Mike

    Imported from legacy forums. Posted by Michael (had 2538 views)

    Xceed Support
    Member
    Post count: 5658

    What you need to do is to replace the ItemsPanel property of the DataGridControl with another one where the ItemsPanelTemplate contains a VirtualizingCardPanel with its Orientation property set to Horizontal.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 237 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks! That pointed me in the right direction. For anyone in the future this is what I came up with. I have higlited the new code in red.

    private void CardViewSelected( object sender, RoutedEventArgs e )
    {
    <snip>

    this.SetColumnSeparator( cardView );
    this.SetAlternativeCardTitle( cardView );
    <color=”Red”>
    FrameworkElementFactory factory = new FrameworkElementFactory(typeof(VirtualizingCardPanel));
    factory.SetValue(VirtualizingCardPanel.OrientationProperty, Orientation.Horizontal);

    ItemsPanelTemplate template = new ItemsPanelTemplate(factory);
    this.grid.ItemsPanel = template;
    </color>

    this.grid.View = cardView;

    Imported from legacy forums. Posted by Michael (had 3206 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi,

    This code did not work in my case may be because some of the classes are obsolete now.

    Can somebody provide me the updated code to have card view horizontally aligned ?

    Alternative suggestions are also welcome

    Thanks,

    Anurodh

    Imported from legacy forums. Posted by Anurodh (had 962 views)

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