Go DevExpress Gridcontrol A little summary of the use of CardView

Source: Internet
Author: User

Recently the project needs to display a series of pictures of the product, intends to use CardView to show that, because the first use, encountered many problems, found that the resources on the Internet is very small, so put their own a little bit of practical experience to summarize for themselves and everyone later reference.

1, select CardView, the original Girview converted to CardView, such as

The effect is as follows:

2, the control by default is vertical arrangement, if you want to change to horizontal arrangement, change the property maximumcardcolumns (the number of cards allowed to arrange horizontally) and maximumcardrows (the number of cards allowed to be arranged vertically).

I set here as: Maximumcardcolumns:-1, maximumcardrows:1, effects such as;

3, to use the card, most of the situation is to display pictures. How to show it? Add an object that stores the picture (I'm here to add the field of the image type directly in the data source), and then change the field's Columnedit type to Pictureedit and named Rowpicture, as

4, also found that the size of the picture is limited, change the CardView (card height adaptive to adapt to the height of the picture) and rowpicture (set the height of the picture) two places of the property can be,



Effects such as:

5, the layout problem solved, the other needs to adjust, in fact, there are properties, here is just a demonstration. How to download the image according to the URL to display, the main code is posted here:

var client = new WebClient ();
Client. downloaddatacompleted + = client_downloaddatacompleted;
Client. DownloadDataAsync (The New Uri (IMG). URL));

private void Client_downloaddatacompleted (object sender, DownloadDataCompletedEventArgs e)

Image img = image.fromstream (new MemoryStream (E.result));

catch (Exception ex)


This is almost the problem, prompt, note the picture is cached to improve performance. "Transfer from CSDN, URL: http://m.blog.csdn.net/blog/yang472024191/4053632"

Go DevExpress Gridcontrol A little summary of the use of CardView

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.