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.

how to get auto size on dbl click header seperator same as excel?

Thread ID:

Created:

Updated:

Platform:

Replies:

41664 Mar 8,2006 12:07 PM Apr 17,2006 11:47 PM Windows Forms 5
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On March 8, 2006 12:07 PM

does anyone know how to get auto size on dbl click header seperator same as in excel?

Administrator [Syncfusion]
Replied On March 8, 2006 06:48 PM

just to be clear at the mo it resizes to the default width...

Administrator [Syncfusion]
Replied On March 9, 2006 02:34 AM

Hi Peterainbow, This can be acheived by using the ResizeToFit method in the ResizingColumns event. Refer to the forum thread for more details. Let us know if you need further assistance. Best regards, Madhan.

Adam K.
Replied On April 16, 2006 09:56 PM

Madhan, This doesn''t seem to work for a Virtual Grid. It only autofits the column header. If a cell in one of the data rows is wider, it doesn''t seem to autofit around that. Any ideas. Thks, ak >Hi Peterainbow, > >This can be acheived by using the ResizeToFit method in the ResizingColumns event. Refer to the forum thread for more details. > >Let us know if you need further assistance. > >Best regards, >Madhan.

Administrator [Syncfusion]
Replied On April 17, 2006 03:20 AM

Hi Adam, In case of a Virtual grid, the column width will be requested and saved by using the QueryColWidth and SaveColWidth event. To resize to the longest text in the column, you can follow the code snippet given below. private void gridControl1_ResizingColumns(object sender, GridResizingColumnsEventArgs e) { if (e.Reason == GridResizeCellsReason.DoubleClick) { GridRangeInfo columns = this.gridControl1.Selections.Ranges.GetRangesContaining(e.Columns).ActiveRange.UnionRange(e.Columns); this.gridControl1.Model.ColWidths.ResizeToFit(columns, GridResizeToFitOptions.IncludeHeaders); e.Cancel = true; } } Thanks for being patience. Best regards, Madhan

Administrator [Syncfusion]
Replied On April 17, 2006 11:47 PM

thks . .worked like a charm !! >Hi Adam, > >In case of a Virtual grid, the column width will be requested and saved by using the QueryColWidth and SaveColWidth event. To resize to the longest text in the column, you can follow the code snippet given below. > >private void gridControl1_ResizingColumns(object sender, GridResizingColumnsEventArgs e) >{ > if (e.Reason == GridResizeCellsReason.DoubleClick) > { > GridRangeInfo columns = this.gridControl1.Selections.Ranges.GetRangesContaining(e.Columns).ActiveRange.UnionRange(e.Columns); > this.gridControl1.Model.ColWidths.ResizeToFit(columns, GridResizeToFitOptions.IncludeHeaders); > e.Cancel = true; > } >} > >Thanks for being patience. > >Best regards, >Madhan >

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.

;