Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
635
Progress bar in a cell and a cell value
posted

Is it possible to have a progress bar in a cell and also show a numeric value in the cell as well. Numeric value would be in the centre of the cell and the progress bar would fill the cell when set at 100%, initial value, and move from right to left as the value decreases.

 For example, we have two columns; target quantity and quantity remaining. Target quantity column would just show the numeric value. The quantity remaining column would show the numeric value and a progress bar that showed the %'age of how much was remaining with regard to the target quantity. So if target quantity was 200 and quantity remaining was 100 I'd like to see 200 in the target quantity column, 100 in the quantity remaining column and a progress bar with a value of 50% also in the quantity remaining column.

Thanks

Jim

Parents
No Data
Reply
  • 34810
    Offline posted

    Hello Jim,

    In order to achieve your requirement on this matter, I would recommend usage of a TemplateColumn in your XamGrid. You can read about TemplateColumns in our online documentation article here: http://help.infragistics.com/Help/Doc/WPF/2016.1/CLR4.0/html/xamGrid_Create_a_Template_Column.html.

    Usage of the template column will allow you to place a StackPanel with a TextBlock and a ProgressBar, which you can then bind to the properties existing on your underlying data item. If you do the calculation of the percentage remaining as a readonly property, you can then bind your ProgressBar to it, by using a procedure much like the bindings shown in the documentation article above.

    I have attached a sample project that demonstrates how this could be achieved. One thing to note, is that the ProgressBar generally shows the percent complete of something, and so to get the percentage remaining, I sent the value through a converter, and you can now see the percentage remaining as a tooltip on the progress bar in the sample project, whereas the progress bar itself is an accurate representation of the percent complete.

    I hope this helps you. Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer

    XamGridProgressBarCellValueCase.zip
Children