We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

adamdc78
Posts: 76
Joined: Wed Mar 19, 2014 7:42 pm

Update ListBox in a Child Dialog

I have a Main dialog which contains a list box of certificates from the Windows certificate store. Below the list box is a button which displays a child dialog which also contains a listbox with details about the certificate (5 lines of text, but I need to be able to scroll it). (See attachments for screenshot).

I have a C# custom action which updates the contents of AI_LISTBOX_DATA when the 'Details...' button is pressed and then I call the custom action to update my listbox. I've tried moving listbox update CA to the child dialog instead, but this didn't help either.

I've tried creating a twin dialog of the main dialog in order to get the child dialog's listbox to update, but the child dialog's listbox doesn't update (I suspect it is because the call to close the child dialog does not actually dispose of the dialog and when I reopen it, the listbox isn't refreshed because there has been no change to the child dialog, but cannot be certain).

1) Is it possible to force the refresh in this case? I could use a property to track which dialog was last displayed and show the other for a twin dialog type of solution, but this doesn't seem right; is there a better way?

- OR -

2) Is there an alternative control with built-in scrolling? Subject and Issuer can be very long. I would very much like to avoid the enhanced UI although that is not a hard requirement.

Thank you,
- Adam
Attachments
Main and child windows
Main and child windows
dialogscreens.png (67.42 KiB) Viewed 3274 times
adamdc78
Posts: 76
Joined: Wed Mar 19, 2014 7:42 pm

Re: Update ListBox in a Child Dialog

For now I'm going to use a Windows Forms box from my C# custom action to accomplish what I need.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Update ListBox in a Child Dialog

Hello,

First of all we apologize for our delayed answer. We had a release yesterday and we were quite busy lately.

Just to make sure I fully understood what you are trying to achieve, you want to populate the list box from you child dialog with some processed data from a C# custom action which is executed as a published event on the [Details...] button of the main dialog, but the content of the child list box is not populated accordingly. Normally, all would you have to do is to add, as published events on [Details...] button , the C# custom action and after it the PopulateListBox action and to make sure that the "AI_LISTBOX_DATA" property is correctly set within your C# custom action.

If you still encounter issues, then it would be very useful for us if you can isolate the behavior in a small buildable sample (aip + its referenced files) and send it us alongside a test case to support at advancedinstaller dot com so we can investigate this on our side.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”