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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Preserve selected line after fill

Thread ID:





23836 Jan 20,2005 06:17 PM UTC Jan 20,2005 07:12 PM UTC WinForms 2
Tags: GridControl
Administrator [Syncfusion]
Asked On January 20, 2005 06:17 PM UTC

Hello, I have a DataTable attached to a gdbg with a currencymanager. When i save my info, i want to clear out all records in my DataTable and refill it with its original data. My code: dt.Update(); int i = cm.CurrentPosition; cm.SuspendBinding(); dt.Fill(); cm.ResumeBinding(); cm.CurrentPosition = i; It works fine but i lost the selected row. My grid show the ten first line of the DataTable anf if my current position is 20, i don’t show this line. (I have to scroll to show the line) I try gdg.Selections.SelectRange(GridRangeInfo.Row(gdg.Binder.PositionToRowIndex(i)),false); but it doesn’t work. Another solution is perhaps to save the position of the scrollBar but i dont’t find how to do that. Thanks

Administrator [Syncfusion]
Replied On January 20, 2005 06:35 PM UTC

The code you listed: gdg.Selections.SelectRange(GridRangeInfo.Row(gdg.Binder.PositionToRowIndex(i)),false); should select the row. But if you also want to scroll it into view, then also call gdg.ScrollCellInView.

Administrator [Syncfusion]
Replied On January 20, 2005 07:12 PM UTC



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon