Hi, I'm facing a problem about keeping multiple scroll bars from different grids in sycn.
I have implemented ability that when I expand a row in grid1, the row with same index in other grids will also be expanded. If they do not have child rows, I will change the row spacing after to make the space between the row and next row same as grid 1.
The problem is when I expand a row in grid 1(let's say this row has 3 child rows), if the row with same index in grid 2 also has 3 child row, then everything goes perfectly. But if there is not child row in grid2, in this case when I slide the scroll bar, the rows in these 2 grids are out of sync. Rows with different index may fall in same line.
Hello Grand,
Thank you for posting in our forum.
Right now there is no such build in functionality in the grid, allowing you to sync the scrolling of two grids. If your grids have the same rows structure, e.g. number of rows and number of child rows, what you can do is handle AfterRowRegionScroll of the grids. In the event handle you can set the scroll position of the active scroll region of both grids to the scrolled value. You can use code like this:
private void UltraGrid_AfterRowRegionScroll(object sender, RowScrollRegionEventArgs e)
{
if (sender.Equals(this.ultraGrid2))
ultraGrid1.ActiveRowScrollRegion.ScrollPosition = e.RowScrollRegion.ScrollPosition;
}
if (sender.Equals(ultraGrid1))
ultraGrid2.ActiveRowScrollRegion.ScrollPosition = e.RowScrollRegion.ScrollPosition;
If the two grids has different rows structure I am not sure if this is possible at all. Consider the grid you are scrolling / expanding has 20 child rows for let say first row. Consider also the second grid’s first row has no any child rows. Where should be scrolled the second grid if the first grid are visible only child rows, e.g. from sixth to tenth row?
Please check the attached sample project where I have implement synchronous scrolling of two grids with same rows structure as described above and let me know if you need any additional information.
Thank you for using Infragistics Controls.
Hi Milko, I have the similar situation except it is a webdatagrid and there are no child rows.Do you have a similar event for webdatagrid(2014.2 version)? Appreciate your help.
Thank you!
Hello,
Could you please be more specific what exactly is the issue that you are facing and what you are trying to achieve. If child grid are no populated this might be caused by missing PrimaryKey -> ForeignKey relating, incorrect DataMember value or missing records that could be associated with the parent value key.
In order not to assume, it would be highly appreciated if you could share more details with me, or better a working sample that is showing the issue.
As for the version that you are using, keep in mind that the version that you are using is no longer supported for Service Releases, my recommendation is to consider upgrading to a newer version of our Product.
Looking forward to hearing from you.
I'm sorry for not replying during thees months. Please see screenshot below:
In above screenshot, you can see that I have four grids and I have succeeded to keep them in sync for many events, such as when you expand a parent row, all rows in the same line will be expanded(as I said the parent level data structure is same).
You might notice that the four scroll bars(pointed by RED arrows) are NOT in same size, which means they have different sizes of scroll regions. It seems to that this is only controlled by the number of visible rows. So I still have the following questions after nearly a years straggling.
1.Does Infragistics allow user to override this?
2.If you DO allow above, please kindly show me the idea.
3.If NOT, is there any suggestion according to the version(V14.2) I'm currently using.