This question is locked. New answers and comments are not allowed.
I have used a custom column in my grid which contains a radprogressbar (from an example on here! see below)
When I used this column the first time the grid displays the progress bar values do not display correctly (see picture 1), then after I sort one by clicking one of the column headings the progress bar displays the correct values (see picture 2)
Any idea why this would happen? The XAML is also below
When I used this column the first time the grid displays the progress bar values do not display correctly (see picture 1), then after I sort one by clicking one of the column headings the progress bar displays the correct values (see picture 2)
Any idea why this would happen? The XAML is also below
<
local:GridViewPercentageColumn
DataMemberBinding
=
"{Binding Turnaround, Mode=TwoWay}"
DataFormatString
=
"{}{0}%"
Header
=
"{Binding Path=CellPathResource.Turnaround, Source={StaticResource ResourcesWrapper}}"
/>
#region PercentageColumn
public
class
GridViewPercentageColumn : GridViewDataColumn
{
public
override
FrameworkElement CreateCellElement(GridViewCell cell,
object
dataItem)
{
var bar = cell.Content
as
RadProgressBar;
if
(bar ==
null
)
{
bar =
new
RadProgressBar();
bar.Height = 20;
bar.Foreground =
new
SolidColorBrush(Colors.Green);
bar.SetBinding(RadProgressBar.ValueProperty,
this
.DataMemberBinding);
cell.Content = bar;
}
return
bar;
}
public
override
FrameworkElement CreateCellEditElement(GridViewCell cell,
object
dataItem)
{
var slider =
new
RadSlider();
slider.Maximum = 0;
slider.Maximum = 100;
slider.SmallChange = 1;
slider.LargeChange = 10;
slider.SetBinding(RadSlider.ValueProperty,
this
.DataMemberBinding);
return
slider;
}
}
#endregion