Hi,
I'm looking for recommendations / documentation on how to use the grid to display dynamically changing data? For example, I have a requirement to show a grid of 100+ rows and ~10 columns where the value in each cell can change potentially change many times per second. However, from a user perspective it will be acceptable to update the visible cells once per second (if the data has changed). I'd also like to provide a visual indication for the cells that have changed values in the latest update (for example, by changing the background color of the cell for half a second).
(The grid actually needs to display ticking market data for all the equity stocks within a particular index (S&P, FTSE, etc.))
Cheers,
Dave.
Hi, I have found a solution to this now. The if conditon needs to be,
if ((drawParams.Element is SummaryValueUIElement) && (drawParams.Element.GetContext(typeof(SummaryValue)) != null))
Hope this helps others.
Jay
I have found a solution to dynamically update an UltraGridCell's BackColor depending on the direction of change of it's value, and using a timer fade the colour back to the original colour. I would also like to do this for Summary row cells. In GetPhasesToFilter what element is associated with drawing a summary value's background? I read that for an UltraGridCell this is the EmbeddableUIElementBase but his doesn't work for summary values.
This is my code so far:
if ((drawParams.Element is TextUIElementBase) && (drawParams.Element.GetContext(typeof(SummaryValue)) != null)){ SummaryValue aSummaryValue = (SummaryValue)drawParams.Element.GetContext(typeof(SummaryValue)); if (aSummaryValue.Value is decimal) { return DrawPhase.BeforeDrawBackColor; }}
return DrawPhase.None;
Thanks in advance
Sounds like you might want to keep a boolean array of indicators of a change. Perhaps set a timer control to 1/2 second intervals.
First period draw second erase.
I have written something similar with tracking GPS locations of golf carts and displaying a grid on the screen using progress bars to show how close each is to the hole. It was an interesting app although not quite as fast changing as this or as much data.
I hope a limited amount of data is changing otherwise I would think it would drive you crazy.
Have fun,
Nick
I am also looking to do this. I have created a DrawFilter to set the background colour. However coparing the cell current value and original value does not behave as I expected.
OriginalValue is never updated from when it was first set.
1) Grid is read only
2) DataSource is a DataSet
3) DataSource is only updated through code
protected virtual void SetCellBackColour(UltraGridCell aCell, ref UIElementDrawParams drawParams) { double newValue = (double)aCell.Value; double origValue = (double)aCell.OriginalValue; if (newValue > origValue) { drawParams.AppearanceData.BackColor = Color.LightGreen; } else if (newValue < origValue) { drawParams.AppearanceData.BackColor = Color.Pink; }
Thanks in advance.
how do you using the source data. If you will use a DataTable as DataSource and make changes to the DataTable the grid will be showing the changes automatically. It also will work if you will use a List<T> or a BindingList<T> and each object in the list is implementing the INotifyPropertyChanged interface.
For the second requiremend I have no solution or tip for you I am sorry.