Is there anyway to force the CellValuePresenter's ValueHistory to store a change in the history if the new value happens to be the same as the current value?
Hello Chris,
I have been looking into your issue and even thought there seems to be no way to add a new DataValueInfo entry into the ValueHistory collection, I did manage to make use of its Tag property to save the number of times a value has been added. Here is a code snippet showing how you can do it:
private void xamDataGrid1_DataValueChanged(object sender, DataValueChangedEventArgs e)
{
if (e.CellValuePresenter != null)
if (e.ValueHistory[0].Value == e.CellValuePresenter.Value)
if (e.ValueHistory[0].Tag == null)
e.ValueHistory[0].Tag = 2;
}
else
int temp;
if (int.TryParse( e.ValueHistory[0].Tag.ToString(), out temp))
e.ValueHistory[0].Tag = ++temp;
Hope this helps. Please let me know if you require any further assistance on the matter.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support
Nice, a hack approach to go with my current hack approach, I like it. I was able to successfully use the Tag property to get the functionality I was originally looking for. Thanks for the help.