Hi.
I am using 10.2 Winforms and have a databound UltraWinTree with a ProgressBarEditor added succesfully using tv_ColumnSetGenerated. The ProgressBarEditor is populated with a percentage in the tv_InitializeDataNode and the progressbar graphics show perfectly. What I can't get to work is getting a label / text to show with the percentage in text.
My code so far:
Private Sub tv_ColumnSetGenerated ....
' Add additional columns Dim Status As Infragistics.Win.UltraWinTree.UltraTreeNodeColumn = e.ColumnSet.Columns.Add("Status")
' Create the ProgressBarEditor Dim pbe as new Ingragistics.Win.UltraWinProgressBar.ProgressBarEditor Status.Editor = pbe
End Sub
Private Sub tv_InitializeDataNode ...
if e.Reinitialize then Exit Sub
Dim StatusCell as Infgragistics.Win.UltraWinTree.UltraTreeNodeCell = e.Node.Cells(e.Node.DataColumSetResolved.Columns("Status")) if StatusCell is nothing then Exit Sub Dim pbe as Infragistics.Win.UltraWinProgressBar.ProgressBarEditor If StatusCell.EditorResolved IsNot Nothing then pbe = StatusCell.EditorResolved else pbe = new Infragistics.Win.UltraWinProgressBar.ProgressBarEditor end if pbe.Minimum = 0 pbe.Maximum = 100 StatusCell.Value = 50 ' This is normally the calculated value, but 50% shown as an example
Any ideas on how I can get the progress bar to show the graphic, and some text behind it would be appreciated. I've tried setting the ProgressBarEditor.Label, but I seem to get the same label value showing for every progressbar on the UltraWinTree.
A partial screenshot of what I am trying to achieve (i.e no text visible) is shown below:
Thanks!
Gary Burgess
Hi Gary,
Here’s are some instructions for initializing the ProgressBar, including setting the format and the Text property. I think this should do the trick.
http://help.infragistics.com/NetAdvantage/WinForms/2010.2/CLR2.0/?page=Infragistics2.Win.v10.2~Infragistics.Win.UltraWinProgressBar.UltraProgressBar.html
Marianne
Hi Marianne,
Thanks for your reply. The instructions you suggested I read relate to the WinProgressBar ... my post is about the ProgressBarEditor (embedded editor), which doesn't have a "Text" property. If you need more clarification about my question, please ask.
Any other ideas would be appreciated.
Regards
Gary
I'm attaching a sample that shows how to do what you need. Basically, what you want here is the Label property on the ProgressBarEditor. There are a bunch of constants defined on the UltraProgressBar class which represent replacement codes for the string.
On a different note, the code you have here is not really a great way to do this. You are setting and re-setting the same properties on the same editor every time a new node is initialized. You don't need to set the editor on the cell, you should just set it once on the entire column. My sample does this, also.
Hi Mike
Thanks for your answer with a concise example - that made it very easy for me to see where I was going wrong. For those that can't be bothered looking at the Zipped solution Mike provided, the trick is to set the ProgressBarEditor.Label to the constant UltraProgressBar.LABEL_FORMATTED which is in fact a string containing "[Formatted]".
I've changed my code to be more concise and it's faster now, thanks to your tips.