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.

dbl-click on the header border

Thread ID:





35850 Oct 11,2005 06:22 PM Oct 11,2005 07:36 PM Windows Forms 3
Tags: GridControl
Asked On October 11, 2005 06:22 PM

I must be missing something obvious. I have a virtual grid, and when I dbl-click on the header border the column sizes to something very defaultish looking - the header text then gets wrapped. Shouldn''t it be looking at the header text and the length of the data in the visible rows? What additional work do I have to do to make that happen? I know about QueryColWidth but don''t understand what the point of it is - it gets fired constantly, even when a mouse moves over a column. Jim

Administrator [Syncfusion]
Replied On October 11, 2005 06:48 PM

In a GridControl, when you double click the border between column headers, the grid reset teh column width to the default column size. If you want sme other behavior, then you can handle the ResizingColumns event. Here is a handler that will do a resizetofit on a double click.
private void gridControl1_ResizingColumns(object sender, GridResizingColumnsEventArgs e)
		GridRangeInfo range = e.Columns; 
		e.Cancel = true;

Replied On October 11, 2005 06:52 PM

Ok, that looks like what I need, thanks. I just assumed that double-clicking would do a "best fit", but guess that was a bad assumption. :)

Replied On October 11, 2005 07:36 PM

I optimized a bit: GridRangeInfo range = GridRangeInfo.Cells(0, e.Columns.Left, uiTraceGrid.ViewLayout.LastVisibleRow, e.Columns.Right);


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.