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.
Syncfusion Feedback

Resize column based DropDownUserControl value

Thread ID:

Created:

Updated:

Platform:

Replies:

35792 Oct 10,2005 12:29 PM UTC Oct 12,2005 10:00 AM UTC Windows Forms 8
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On October 10, 2005 12:29 PM UTC

I''m using a drop down user control to allow users to select a value for a cell. What I want to happen when the user selects a value is for the column width to resize to fit the selected text. I''ve tried handling the CurrentCellChanged event and using the ResizeToFit method, but the CurrentCellChanged event doesn''t fire when the user selects a value from the drop down user control. Is there some other event I should be handlling? Thanks Akash

Administrator [Syncfusion]
Replied On October 10, 2005 01:33 PM UTC

Try using the CurrentCellCloseDropDown event. If the CurrentCell is your special dropdown, then first call grid.CurrentCell.ConfirmChanges and then make your ResizeToFit call.

Administrator [Syncfusion]
Replied On October 11, 2005 11:57 AM UTC

Sorry Clay, that didn''t work. I''ve modified the dropdownusercontrol sample to illustrate. Note that the resize works when called from form_load but not when called from Grid_CurrentCellCloseDropDown. By the way, I''m using v3.3.0. Akash P.S. Upload doesn''t seem to be working at the moment - will try to upload the sample later.

Administrator [Syncfusion]
Replied On October 11, 2005 07:05 PM UTC

The upload facility still seems to be broken...I''ve tried it from home and the office. Any ideas?

Administrator [Syncfusion]
Replied On October 11, 2005 07:21 PM UTC

You can email it to support@syncfusion.com and mention this thread in its title. Also update this thread so I will know when you have sent it.

Administrator [Syncfusion]
Replied On October 11, 2005 08:57 PM UTC

I''ve emailed the sample as you suggested. Thanks.

Administrator [Syncfusion]
Replied On October 11, 2005 09:49 PM UTC

In CurrentCellCloseDropDown, try this code: Me.gridControl1.CurrentCell.EndEdit() Me.gridControl1.Model.ColWidths.ResizeToFit(GridRangeInfo.Cols(0, Me.gridControl1.ColCount), GridResizeToFitOptions.None)

Administrator [Syncfusion]
Replied On October 12, 2005 09:56 AM UTC

Thanks Clay, that worked. On a related note, is there any documentation that describes the grid event model at a higher level than the Class Reference? I''m looking for something that describes the sequence of events that occur, and how the various methods relate to those events. Such documentation could help with queries such as this one, as the chances of stumbling upon the EndEdit method by trawling through the class reference are minimal. Thanks Akash

Administrator [Syncfusion]
Replied On October 12, 2005 10:00 AM UTC

Currently, there is not such a document. In the CellType samples, there is a tracing utility that lets you display currentcell events being hit in a trace log window. That is one way to see what events are raised as you edit and move from cell to cell.

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

;