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. Image for the cookie policy date
close icon

Col.ResizeToFit with ButtonEdit in VirtualGrid

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.

2 Replies

AD Administrator Syncfusion Team February 2, 2007 06:05 PM UTC

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


KD Kyle DeVoe February 2, 2007 07:11 PM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon