Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
746
How can I use xamdatapresenter or xamdata grid to display images in a matrix
posted

I know this can be done using WPF Uniformgrid, however, I would like to know how (or if) I can display data in a matrix using infragistics controls, such as when displaying a number of images.  I would like the user to be able to switch between the carousel and a matrix view of the images.  can this be done or not, and if so how?  Thanks for any help...

Parents
  • 69686
    Suggested Answer
    posted

    Hello,

    This could be done with the XamDataPresenter, however you need take several things into consideration.

    You have to create a DataSource for the XamDataPresenter so that it will be able to display the data the you like it to. The DataSource is of type IEnumerable, so for example,  you need a collection which holds object of custom data type. Note, that each public property will be displayed as a Field (column) and each object in the collection as a record (row). That being said, you need to have as many properties as items inside the collection.

    You need to retemplate the CellValuePresenter, so that it contains an Image element and bind it to the underlying value. If you do not know how to do that, you can see a good example here.

    Switching before matrix and carousel view can be achieve by setting a new View on the XamDataPresenter's View property.

    Let me know if you have further questions on this.

Reply Children