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.

Col.ResizeToFit with ButtonEdit in VirtualGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

55696 Feb 2,2007 12:31 PM Feb 2,2007 02:11 PM Windows Forms 2
loading
Tags: GridControl
Kyle DeVoe
Asked On February 2, 2007 12:31 PM

Hello,

I am implementing the custom cell "ButtonEdit" from the syncfusion examples. In my code, we are using a virtual grid. When I use the button to choose something, I need to resize the col to make the text fit. The col is resizing, but the end of the text is still under the button. How can I make all of the text visible, with none hidden under the button?

thanks.

Administrator [Syncfusion]
Replied On February 2, 2007 01:05 PM

Hi Kyle,

You should override the OnQueryPrefferedClientSize method in ButtonEditCellModel and return the size of the cell based on the ButtonBarSize of the ButtonEdit cell. Please try this and let me know if this helps.

protected override Size OnQueryPrefferedClientSize(Graphics g, int rowIndex, int colIndex, GridStyleInfo style, GridQueryBounds GridQueryBounds)
{
Size size = base.OnQueryPrefferedClientSize(g, rowIndex, colIndex, style, GridQueryBounds);
return new Size(size.Width + 20, size.Height); // base method already consides ButtonBarSize, but let's add some more pixels here.
}

Thank you very much for your interest in Syncfusion’s products.

Best regards,
Haneef

Kyle DeVoe
Replied On February 2, 2007 02:11 PM

Haneef,

that works great. Thanks! The code was already there, it was just commented out. Not sure why.

thanks,
Kyle

>Hi Kyle,

You should override the OnQueryPrefferedClientSize method in ButtonEditCellModel and return the size of the cell based on the ButtonBarSize of the ButtonEdit cell. Please try this and let me know if this helps.

protected override Size OnQueryPrefferedClientSize(Graphics g, int rowIndex, int colIndex, GridStyleInfo style, GridQueryBounds GridQueryBounds)
{
Size size = base.OnQueryPrefferedClientSize(g, rowIndex, colIndex, style, GridQueryBounds);
return new Size(size.Width + 20, size.Height); // base method already consides ButtonBarSize, but let's add some more pixels here.
}

Thank you very much for your interest in Syncfusion’s products.

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.

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.

;