We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

TopRowIndex to scroll grid up

Thread ID:

Created:

Updated:

Platform:

Replies:

21048 Nov 1,2004 02:13 PM UTC Oct 21,2005 12:13 PM UTC WinForms 7
loading
Tags: GridControl
Dan
Asked On November 1, 2004 02:13 PM UTC

Using grid 1.6.1.8, we are using TopRowIndex to set the top row of our virtual grid. When the row we want to set as the TopRowIndex is close to the bottom of the grid, the grid is not scrolled completely to that row as the top, since that would leave "empty" space below it in the bounds of the grid. example: grid has 100 rows, 30 fit on a "page" in the grid, set TopRowIndex = 90, the top row will actually be 70. Is there any way to change/turn off this behavior so the top row is really set with TopRowIndex?

Administrator [Syncfusion]
Replied On November 1, 2004 02:47 PM UTC

I think you will have to handle this yourself. In the TopRowChanging event, check the new value. If it will leave empty space, then you can change it. You could try using this.gridControl1.ViewLayout.VisibleRows and this.gridControl1.RowCount to see whether teh new value should be adjusted.

Dan
Replied On November 2, 2004 02:12 PM UTC

Thanks Clay. Not sure I understand your suggestions. I added a handler for the TopRowChanging event, but it''s not fired by the grid in this situation. When I set TopRowIndex to something that will cause the grid to scroll, the event fires. If the TopRowIndex is set to a row near the bottom (within VisibleRows of the bottom of the grid), then the event doesn''t fire. If the event doesn''t fire in the case where I''d want to do some special processing, not sure I understand what you meant in your suggestions. Thank you!

Administrator [Syncfusion]
Replied On November 2, 2004 03:33 PM UTC

I think I misread your question before. You want to see empty space under the bottom of the grid. I thought you wanted to avoid this empty space. Here is a rough try at this by deriving the grid and overriding SetTopRow. It showed blank space using 2.1.0.9. But I am not sure if the methods I used were exposed in 1.6.1.8 or not. WindowsApplication5_4790.zip

Catinat Velmourougan
Replied On October 21, 2005 06:06 AM UTC

hi, I am using a ggc.My top row index works fine without the grouping.When theres grouping the toprowindex doesnt work fine.It behaves erratic. Can you suggest how to improve it? regards, catinat

Administrator [Syncfusion]
Replied On October 21, 2005 07:08 AM UTC

TopRowIndex is inherited from GridControlBase, so it has no knowledge of things like groups, summaries, etc that are part of the GridGroupingControl. What are you trying to do with the TopRowIndex? How are you trying to use it? There may be another way to do what you want in the GridGroupingControl.

Catinat Velmourougan
Replied On October 21, 2005 08:13 AM UTC

hi, We have a find functionality on the grid grouping control. When we find the correct record, we need to set it as the current record.We use the toprowindex to bring the found record to the top. How can we achieve this? regards, catinat

Administrator [Syncfusion]
Replied On October 21, 2005 12:13 PM UTC

Try code like: // rec is the GridRecord you want to scroll if(rec.ParentGroup != null) rec.ParentGroup.IsExpanded = true; int i = this.gridGroupingControl1.Table.DisplayElements.IndexOf(rec); this.gridGroupingControl1.TableControl.TopRowIndex = i; //if you want to set it current or select it rec.SetCurrent(); rec.SetSelected(true);

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;