Is there a way to cause a datagridview to operate like an Android custom listview? RRS feed

  • Question

  • Hello, I have been working on a simple program that displays information retrieved from a database.  I want each displayed record to be presented in a scrollable list and for the visual presentation of the data to be uniform, using several images, several icons, and number of text labels with different fonts.  I found several ways to do this with Android and Java, but I have not been able to find any way to achieve this with Windows desktop and visual basic.  So far, I have been using a datagridview and slaving to dress it up as much as I can.  The final result is always extremely disappointing, no matter how hard I try to modify the datagridview.

    Does visual basic have a way to create a scrolling list of cards, allowing for more variety than the horizontal rows of the datagridview?

    Below is a screenshot from an Android device showing a general idea of what I want to attain with my visual basic program.

    Thank you for taking the time to read my question!

    Friday, April 19, 2019 1:54 PM

All replies

  • Hello,

    Have you considered using Xamarin? If not see building mobile apps.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    profile for Karen Payne on Stack Exchange

    Friday, April 19, 2019 1:59 PM
  • Hi,

    Does visual basic have a way to create a scrolling list of cards, allowing for more variety than the horizontal rows of the DataGridView?

    Yes, use WPF.

    Best Regards / Viele Grüße
    Peter Fleischer (former MVP for Developer Technologies)
    Homepage, Tipps, Tricks

    Friday, April 19, 2019 4:21 PM
  • Maybe define a UserControl for one element. Use labels, images, colours, etc.

    Then create and place such controls inside a FlowLayoutPanel programmatically. (Use panel.Controls.Add). Set the specific texts and other properties. Use these settings of the panel: AutoScroll=True, FlowDirection=TopDown, WrapContents=False.

    • Edited by Viorel_MVP Friday, April 19, 2019 5:58 PM
    Friday, April 19, 2019 5:55 PM
  • You can use a FlowDocumentScrollViewer control,  with ElementHost in WinForms

    (I did some tests and you can add anything inside, even videos with BlockUIContainer)

    • Edited by Castorix31 Friday, April 19, 2019 8:38 PM
    Friday, April 19, 2019 8:03 PM