Question

Displaying a table of results on a windows form

Hi,

Does anyone happen to have a really simple automation whereby a number of results are added to a table, that's displayed back to the user on a windows form. For example, the demo I have looks at a folder and counts the number of files by file type, but I'd then like to display the result back on the windows form in a table rather than creating labels/text boxes.

Does anyone have something like this they could share please?

Many thanks,

paul.

***Edited by Moderator: Lochan to update post title***

Correct Answer
September 13, 2019 - 9:52am

Here is a quick example. Use the TabelView on the UI to join the DataGridView to a LookupTable. If you do this though, you need to make sure all updates to the LookupTable are done off of a thread (and event) from the Windows Form (UI) or you will freeze your UI.

Comments

Keep up to date on this post and subscribe to comments

Pega
September 13, 2019 - 9:52am

Here is a quick example. Use the TabelView on the UI to join the DataGridView to a LookupTable. If you do this though, you need to make sure all updates to the LookupTable are done off of a thread (and event) from the Windows Form (UI) or you will freeze your UI.

September 17, 2019 - 6:38am
Response to tsasnett

Hi..

Thanks again for this.

Are you able to explain though how I would add another column to the results and populate it (i.e. in your example, perhaps the last data modified)? I've tried a few things, but nothing seems to have worked.

 

Thanks.Paul

Pega
September 17, 2019 - 9:43am
Response to PaulB784

You should be able to add a field into the Lookup Table tblFiles. That is connected to the grid via the TableView component. You might need to reset the Datasource property of the DataGridView to see it in design time after you've added the field to the table.

September 13, 2019 - 10:05am

Awesome - many thanks for this. Should be really useful.