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.
Unfortunately, activation email could not send to your email. Please try again.

DataGrid Scrolling Behavior

Thread ID:

Created:

Updated:

Platform:

Replies:

13046 Apr 19,2004 01:24 PM Apr 21,2004 08:40 AM Windows Forms 2
loading
Tags: GridControl
Aaron Jackson
Asked On April 19, 2004 01:24 PM

Thanks to my nitpicking QA department I have an odd question (and no source code, sorry I''m working on it). I create a dataGrid with N columns. The Nth column is partially visible (i.e. part is on the screen, part is off screen). Whenever the user clicks on the last cell the entire grid shifts so that it becomes visible. AllowSelection is set to "Column, AlphaBlend". I went so far as to catch the SelectedCellChanging event and set the Cancel property to true. The grid still shifted as if it had set the current cell, shifted to make it visible and then cancelled. I''ve done the same with CurrentCellChanging to no avail. At this point, the only thing I can think of is to manually set the current cell once this sequence occurs to manually force its hand. Any thoughts?

Administrator [Syncfusion]
Replied On April 19, 2004 06:19 PM

I am not sure what you are trying to cacnel. Is is that you do not want to scroll the grid at all in this case. This means the cell on right will not be visible. How do you want you user to indicate he wants it visible???? I think you can prevent the scroll by handling LeftColChaning and cancelling it in this case. private void gridControl1_LeftColChanging(object sender, GridRowColIndexChangingEventArgs e) { if(this.gridControl1.ViewLayout.LastVisibleCol == this.gridControl1.ColCount) e.Cancel = true; }

Aaron Jackson
Replied On April 21, 2004 08:40 AM

That did the trick, but to answer your question. This window is for better or worse a readonly window that the users drop on their screen and it displays scrolling stock market information. One of the options the user has is to turn off the scrollbars (see an earlier question of mine). When this is done, the window conserves space by not showing the scrollbar and the user will often compress the window to roughly the size of the table. Of course we''re fallible and we''ll make the window just a little smaller that the last column so that its "partially" visible (even though its 99.95% visible). When the user originates a mouse press (for instance for the context menu) it will cause the window to shift. Now with no visible means to move the columns back and they get frustrated (keys work, but its not something they''ll pick up immediately). Hope that clarifies it for you, thanks for the answer.

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.

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.

;