I created ValueToDisplayTextConverter for show in a one cell of a XamDataGrid both string and numeric data . The format property is using to change accuracy.
public class ValueToDisplayTextConverter : IValueConverter
{
public static string Format = "{0:0.00}";
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture){.....}
..........
}
When i need to change accuracy then i set another value to the format property and reload DataSource of a XamDataGrid:
protected double scrollOffset = 0;
public void UpdateAccuracy(string newFormat )
ValueToDisplayTextConverter .Format = newFormat;
scrollOffset = DGridDelivery.ScrollInfo.VerticalOffset;
DGridDelivery.DataSource = null;
DGridDelivery.DataSource = dataSource.DefaultView;
void DGridDelivery_LayoutUpdated(object sender, EventArgs e)
DGridDelivery.LayoutUpdated -= new EventHandler(DGridDelivery_LayoutUpdated);
DGridDelivery.ScrollInfo.SetVerticalOffset(scrollOffset);
But some cell with similar values (like an "1,111" and "1,111") into them do not call converter and do not change display value.
I spent much time but can't to solve this problem.
Hello Nikolay,
It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking through your post but I wasn’t able to reproduce your behavior on my side. If this is still an issue for you I will be glad if you send me an isolated sample, so I can investigate this further for you.
Feel free to write me if you have further questions.