Hi,
I have a wingrid that uses row layout and there is a thread that runs behind (Basically a timer). I'll refresh the data in the grid every 1000 msec. based on the thread. Since row layout is used, after couple of refreshes' the layout is going for a toss. How to reset the rowlayout.? Tried with ResetRowLayout, but in vain..I have this row layout in initializelayout event.
In simple words, i have to refresh the grid data being displayed. I have to hit the db and bind the values again.
Any help is appreciated.
I'm not sure I understand your question.
It sounds like maybe you need to save the DisplayLayout of the grid and then re-load it.
But even if that works, it sounds like what you are doing is extremely dangerous. If you are modifying the data source that the grid is bound to on another thread, this will almost certainly cause problems. The grid is not multi-thread safe, nor is the BindingManager. The grid or the DotNet Bindingmanager could, at any time, ask for the value of a cell or some other property setting from the data source, and if that data source is in the middle of being modified on a different thread, it could cause your application to crash or your data to become corrupted. Not only will this almost certainly cause problems, the problem will be nrealy impossible to track down, since it will occur on a different thread.
Mike,
I want to refresh the grid every 5 minutes. As said earlier, threading is one such approach which now i understand is 'dangerous'. It makes that much difficult to refresh the grid using a Timer as i have row set layouts in grid's initialize layout event and the origin x,y gets disturbed each time the datasource is set.
Pls suggest the best way to refresh the grid..