Advice on the best way to implement this...

1 Answer 29 Views
GridView ListView
Alessandro
Top achievements
Rank 2
Iron
Iron
Iron
Alessandro asked on 29 Feb 2024, 10:41 AM

I need to quickly develop an 'updater' application that allows updating one or more software. I would like a look similar to the Adobe updater. What should I choose as a component? A grid? A ListView? Is it possible to have a column in the grid that changes its appearance: switches from a button to a progress bar?

 

1 Answer, 1 is accepted

Sort by
1
Accepted
Dinko | Tech Support Engineer
Telerik team
answered on 01 Mar 2024, 12:46 PM

Hi Alessandro,

Thank you for your interest in our Telerik UI components for WinForms.

By looking at the image, you could consider using RadListView control with Details View. You can get familiar with the control with its Getting Started article. This way you separate the properties of your object in different columns arranged in list format. As for the button on the right, you can create a custom item. You can check how this can be done in the Custom Items in DetailsView ViewType help section.

Another control indeed could be RadGridView. You will need to customize it a little bit to look similar to the list component in your image. For example, hide the header row. The answer to your last question is yes, you can customize the cell and place a button or progress bar. How to place a progress bar is demonstrated in the Creating custom cells help article.

The control which will be chosen depends on your requirements. You can use the one that most fits your application and exposes the required functionalities.

Let me know if further assistance is required.

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Alessandro
Top achievements
Rank 2
Iron
Iron
Iron
commented on 04 Mar 2024, 03:01 PM | edited

Thank you Dinko for your response.

In fact, I chose to use a RadListView following the example of the demo application where cars are listed (custom listView). I opted to use a GridLayout instead of a StackLayout and I am deciding based on the update status whether to show a RadDropDownButton or a RadProgressBar. (so I draw a RadDropDownButtonElement and a RadProgressBarElement inside the GridLayout). However, now I have the following problem: the update downloads are an asynchronous operation and I need to show on the row corresponding to the software I am updating the progress in %. I can't figure out the best way to do it. Currently, I am trying to do it through .invoke on the radListView...but the progress is not visible. Any help? Is there anything I need to know about updating one of your controls from a task that is not the main form? Best regards.

Alessandro
Top achievements
Rank 2
Iron
Iron
Iron
commented on 04 Mar 2024, 04:14 PM

...To clarify: I may have n software being updated, and asynchronously, I am downloading the files for the update, and I should update a progress bar indicating the progress.

 

like in this screenshot:

Alessandro
Top achievements
Rank 2
Iron
Iron
Iron
commented on 05 Mar 2024, 08:43 AM

Perhaps I have found a solution: from the asynchronous task, I need to instruct the RadListView control to update the row whose object is CDataObject (data bound item) using listView.Invoke. Then, in the custom listView, I can access the 'custom' visual element using:

 


CRigaCustomListView customRow =
listView.ListViewElement.ViewElement.GetElement(item) as CRigaCustomListView; 

... thereafter, I can access the individual controls that have been rendered within the custom row (e.g., the progress bar).

Dinko | Tech Support Engineer
Telerik team
commented on 05 Mar 2024, 11:23 AM

You are in the right direction. Note that all UI controls are not thread-safe controls in the whole Windows Forms platform (not just Telerik controls, but all controls out there). Here is an article on MSDN, describing how to make thread-safe Winforms UI applications. This means that any control from the Telerik UI for WinForms suite is not thread-safe as well and cannot be used outside the main UI thread. You should use an Invoke (as you have already done) to update the controls in cross threading scenario.

Alessandro
Top achievements
Rank 2
Iron
Iron
Iron
commented on 07 Mar 2024, 11:29 AM

Hello Dinko,

I still need to solve the following issues: for clarity, I'm attaching a screenshot below:

1) the RadApplicationMenu component (1) doesn't seem to adjust in height, it's like it has a fixed height that doesn't fill the container, also I would like it to be white with small gray horizontal lines... is it possible?

2) The RadDropDownButtonElement component (2,3) is inserted into a GridLayout, but I would also like to give it a customized look, e.g., a blue background instead of gray, rounded borders instead of rectangular... similarly, in case 3) I would like the gray button outlines not to be visible. Can I do all these things?

Dinko | Tech Support Engineer
Telerik team
commented on 11 Mar 2024, 03:54 PM

The conversation was transferred to a private ticket thread as per your request.
Alessandro
Top achievements
Rank 2
Iron
Iron
Iron
commented on 12 Mar 2024, 09:17 AM

In case it might be useful for other programmers in the community... I solved the problem regarding the customization of the style of the elements in a custom listview by moving the style application that was previously in "CreateChildElements" to the "SynchronizeProperties" function.

example : styling the button (2) for rounded shape and backcolor:


//action button = la parte bottone del dropdownbutton
RadButtonElement actionButton = this.btnSceltaAggiornamento.ActionButton;
actionButton.ButtonFillElement.BackColor = coloreSfondoSceltaAggiornamento;
actionButton.ButtonFillElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
actionButton.Shape = new RoundRectShape(8,true,true,false,false);
actionButton.ForeColor = Color.White;

//arrow button = la parte con la freccia del dropdownbutton
RadArrowButtonElement arrowButton = this.btnSceltaAggiornamento.ArrowButton;
arrowButton.Fill.BackColor = coloreSfondoSceltaAggiornamento;
arrowButton.Fill.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
arrowButton.Shape = new RoundRectShape(8, false, false, true, true);

Good job, everyone

Alessandro

 

Tags
GridView ListView
Asked by
Alessandro
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or