I''ve got multiple grids that need to have their vertical scrolling synchronized. I searched the knowledge base and found a reference to Q10530. I tried doing what the text briefly describes, but it doesn''t quite work right. I get into a continuous scrolling on the selected grid, until it runs out of stack space. Unfortunately, I can''t retrieve the example code from the link. IE is complaining the site does not exist. Can someone send me the example code from this aritcle and/or help me stop the continuous scrolling effect?
ADAdministrator Syncfusion Team November 23, 2004 05:00 PM UTC
We have had some web woes in the last day or so, and have had to move some things around. As a result, that link was broken. That download link from the KB should be working now.
JBJohn BowmNovember 23, 2004 07:15 PM UTC
Thanks for hunting down the link. I managed to get the .ZIP file OK. I''ll let you know if I still can''t resolve it after going through the example code.
JBJohn BowmNovember 29, 2004 04:58 PM UTC
Now that I''m back from vac. I''ve been trying to make this work. But alas, it doesn''t. Here''s the details. I''ve got a tab control that has 1 grid on each tab page. The number of tabs (& therefore number of grids, as well as their respective names) is dynamically determined at run time and can vary when the tab control is created/loaded w/ data. Thus, in the OnTopRowChanged event handler, I must roll through all the grids present and update their respective TopRowIndex accordingly. Here''s my current code:
//Roll through all the grids we have and set their TopRowIndex to this one''s.
int CurrrentGridsTopRowIdx = e.SavedValue;
Syncfusion.Windows.Forms.Grid.GridControl CurrGrid = (Syncfusion.Windows.Forms.Grid.GridControl)sender;
foreach(TabPage tbCurrPage in m_tbCtrl.TabPages)
Syncfusion.Windows.Forms.Grid.GridControl NextGrid = GetCurrentPageGrid(tbCurrPage);
if (CurrGrid.Name != NextGrid.Name)
NextGrid.TopRowIndex = CurrrentGridsTopRowIdx;
//Force this one up the UI level.
throw new Exception(eAll.InnerException.Message);
Note that the GetCurrentPageGrid(tbCurrPage) call simply loops through all the controls on the passed in tabpage and locates the grid object and returns the 1st one it finds.
Any more ideas? Thanks again!
ADAdministrator Syncfusion Team November 29, 2004 05:35 PM UTC
Thanks for the "fixed code".. & so fast. That seems to do it. However, I came up w/ an alternative that also seemds to work that I would like your opinion on. Basically, I could handle the Tab Control''s SelectedIndexChanged event and then compare the PreviouslySelectedGrid.TopRowIndex vs NewlyelectedGrid.TopRowIndex and if different update the NewlySelectedGrid.TopRowIndex. Do you see any (dis)advantages using either approach?
ADAdministrator Syncfusion Team November 29, 2004 09:40 PM UTC
I think your solution is fine as long as you only care about the visible grid having its toprowindex set. The other (nonvisible) grids will still have their old toprowindex. As long as this is ok with your requirements, then I think it is fine.
JBJohn BowmNovember 30, 2004 09:42 AM UTC
Thanks again for the help & opinion. Now to determine which one and implement it for real...