Display Progrgress Percentage in datagridview column

Answered
0
0

Hi Team,

I want to display progress percentage in a datagridview column as shown in d attached images.

Also, i want to get the splitcontainer control to dock a collapsed panel on d side (right or left or up or down) also as shown in the attached images.

Please help me out if these are possible.

  • You must to post comments
Best Answer
1
0

Hi Team, my client requested that the items be displayed in the middleLeft as alignment for the datagridview columns but i realised the progress bar gets distorted when i set the defaultCellStyle alignment to middleLeft as can be seen in the top datagridview vs the bottom grid  in the attached image.

What could be wrong pls.

  • Levie (ITG)
    Hi Nicholas, You just need to set text-align: left instead of center in the HTML that displays the ProgressBar. HTH, Levie
  • Nicholas
    Hi Levie, it seem i didnt explain my point well. What i meant is that i need to display the text in all d other columns to MiddleLeft in the rowtemplate settings of the gridview. But when i do that it distorts the progress bar display. The progress columns text display can remain in the center as it is currently.
  • Levie (ITG)
    Hi Nicholas, you can set the DataGridView.DefaultCellStyle.Alignment property to MiddleLeft (instead of RowTemplate). Just make sure to set the column for the ProgressBar to TopLeft. Best, Levie
  • You must to post comments
1
0

Hi

For customize the datagridcells, the recommended approaching is use html with div into it using CellFormating event like this

e.Value = $"<div style='height:100%'><div style='background-color:yellow;width:{value}%;height:100%'></div>" +
$"<div style='width:100%;left:0px;top:0px;position:absolute;text-align:center;top:50%;transform:translateY(-50%);'>{value}%</div></div>";

it’s all plain html and it requires a good amount of trial and error

I attach a runnable sample with also showing the use of splitContainer control for the other question

HTH

  • You must to post comments
1
0

Nicholas

We are checking this and back you to comment about it

thanks for your feedback

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.