User (Old forums)MemberMay 12, 2008 at 12:11 pmPost count: 23064
Searching for a solution to my problem I found a topic refering exacly to it.
Sadly, the discussion wasn’t completed. (http://xceed.com/CS/forums/thread/3208.aspx)
Well, first the context:
– Drawing my grids is taking too long, this way I’m researching a way to reuse already drawn grids. What I though about is that changing the DataSource would be much quicker than redrawing everything. (Is this correct? I don’t really know… I was going to test and see what happends)
1) If it is the first time the grid is drawn.. it does everything correcly and shows everything the way it should be.
2) If it is not the first time, and the last grid can be reused (the parameters that are involved with the grid display are the same), just change de datasource. (problem occurs)
//Copys the last grid
Agrid = (GridControl) gridLastGrid.Clone();
//Modify the grid
//Agrid.SetDataBinding((DataSet) AdsData, “Resumes”); <- Solution from the topic I referred (didn’t work)
Agrid.DataSource = AdsData;
//Updates last grid
gridLastGrid = (GridControl) Agrid.Clone();
In the topic I referred to, CharlesB points that the problem could be the DataMember not being set up. Well, since Agrid receives a copy from gridLastGrid (that shows up correctly) it should work fine (DataMember from Agrid is set, I saw it in debug mode)
Agrid receives DataRows from gridLastGrid (2datarows), but when I change the datasource, the number of datarows is set to zero.
I expected that the number of datarows would be updated with the EndInit()… but that won’t happen, and that’s my problem.
Ps. AdsData is exacly the same from the first time drawn grid. I’m using the same to test my code.
Anyone got any ideas on how to solve this?
Thanks in advance.
Imported from legacy forums. Posted by Oscar (had 640 views)
- You must be logged in to reply to this topic.