Hello,
I am using ultrachart in ultragrid. I have 8 different columns : Name, Id, scorePoints, ultrachart ( for showing score w.r.t. timing tick) & other columns.
my datasource for ultraGrid is datatable and for ultraChart column(in datatable) , I am using list<ChartDataLive> as datatype ( scorePoint, timeTick)
my datatable is updating every minute. when m doing ultraGrid1.datasource = myDatatable every minute, chart is showing fine.
but when updating grid cell individually, the data updating perfectly for other columns except ultrachart column.
means, ultrachart column is showing data , it has consumed at first attempt of ultraGrid1.datasource , not the updated one.
My requirement is to update cell individually after first attempt of datasource.
please suggest better approach for this.
Just to expand a bit on Mike's answer...
If you bind the UltraWinGrid to a DataSet, DataTable, or any BindingList<T>, then the data source itself will track when a cell value changes (is set) and send a notification that something has changed. And then a bound control, like the grid, can listen to that notification and update the display. But if you have a cell that contains a complex object, like a List<T>, then unless you are setting the value of that field in the data source to a new List object, the data source won't know that anything changed. If you are adding or removing items from the List, or if you are getting an item in the list and changing the properties of that item, then the DataSource has no way of knowing that and cannot know that the value of the field has changed, because as far as it's concerned, the field is still holding a reference to the same object. There are ways around that. You could create your own DataSource that hooking into the events of the List and then your List would have to hook into the notifications of the items within that list and bubble up those notifications. And you are using your DataSource to bind to a bunch of different control, it might be worthwhile to do that. But if you are only binding to the grid, then the simplest thing to do is to just send a notification to the grid whenever you know your code has modified the list. And the way to do that is to call the Refresh method on the row:
this.ultraGrid1.Rows[0].Refresh(RefreshRow.ReloadData);
I tried to upload full code, but able to upload files only.
Following is the sample code which displaying the issue I stated above.
check if I rightly put this.ultraGrid1.Rows[0].Refresh(RefreshRow.ReloadData);
Please let me know the right approach.
SampleCode.zip
I see you are embedding an Image of the chart and attempting to update the cells rather than embedding the chart directly and updating its datasource. This needs some more investigating.
Here is an example of loading our UltraChart in the UltraGrid directly in case you are interested. 0654.WindowsFormsApplication7.zip