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
695
Question about incosistency value at UltraGrid.AfterCellUpdate(e.cell.originalvalue)
posted

Hi,

I assign a ValueList to a cell: -

Infragistics.Win.ValueList vl;

vl = grid.DisplayLayout.ValueLists.Add("TestValueList");

vl.ValueListItems.Add(1, "A");

vl.ValueListItems.Add(2, "B");

grid.DisplayLayout.Bands[0].Columns[2].ValueList = grid.DisplayLayout.ValueLists["TestValueList"];

Then at UltraGrid.AfterCellUpdate(): -

private void grid_AfterCellUpdate(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)

{ …

                grid.EventManager.SetEnabled(Infragistics.Win.UltraWinGrid.GridEventIds.A      fterCellUpdate, false);

 

                                if (e.Cell.OriginalValue.ToString() == "A")

                                { e.Cell.Value = 1; }

                                else

                                { e.Cell.Value = 2; }

                                grid.EventManager.SetEnabled(Infragistics.Win.UltraWinGrid.GridEventIds.A      fterCellUpdate, true);

 

 }

 

However, I couldn’t get a consistent value back at the e.Cell.OriginalValue: -

Original value selected is A

Test attempt

Value

Text

OriginalValue

Select “B” in the list

2

B

A

Select “A” in the list

1

A

2

 Why the OriginalValue sometimes return me Text of the value list and sometimes is the selected index?

How can i restored the original value?

Thanks