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

GridControl automatically horizontally scrolls right

Thread ID:

Created:

Updated:

Platform:

Replies:

69594 Nov 2,2007 09:33 PM UTC Nov 2,2007 10:10 PM UTC WinForms 1
loading
Tags: GridControl
Nick
Asked On November 2, 2007 09:33 PM UTC

Hi,

I'm wondering if this is possible. I want to use the grid to allow me to show the contents of a massive file, so I'm using it as a virtual grid. I have two columns, the first one being narrow, just to hold a line number value. The second column I want to use to show the line from the file. The problem is the line in some cases is over a thousand characters wide.

I have two problems. First, when the user selects the second column with the mouse, the grid automatically scrolls to fit as much of the second column in the view as possible, so the line number column just disappears; I dont want this to happen. My second problem is that I cannto seem to get the column width of the second column wide enough. I am handling QueryColWidth and returning something like 3000, which just abouts first one of my lines.

I'm wondering if there is a better control to view this. I'm basically needing to render a large file, both vertically and horizontally, using two columns.

Any advice most appreciated.

Nick.

haneefm [Syncfusion]
Replied On November 2, 2007 10:10 PM UTC

Hi Nick,

Regarding the First Issue :
>>>>>>>>>>>>>>>>>>>>>>>>
The AllowScrollCurrentCellInView property specifies the mask for which reason the scrolling should happen, this defines the ScrollCurrentCellInView behavior of the grid. You can try setting this to GridScrollCurrentCellReason.None and let me know if this helps.

this.gridControl1.Model.Options.AllowScrollCurrentCellInView = GridScrollCurrentCellReason.None;

Regarding the Second Issue :
>>>>>>>>>>>>>>>>>>>>>>>>
To resizetofit the column widths and rowheights for the header row in grid, the following code can be used.

grid.ResetVolatileData ();
grid.Model.ColWidths.ResizeToFit(GridRangeInfo.Cells(1,1,grid.ColCount,grid.RowCount));
grid.Model.RowHeights.ResizeToFit(GridRangeInfo.Row(0));

If you are handling the QueryColWidth and QueryRowHeight events, then you can follow the approach mentioned in the below forum thread by having a hashtable to cache the changed sizes and set this in the query events.
http://www.syncfusion.com/support/Forums/message.aspx?MessageID=33561

Best regards,
Haneef

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

;