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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Virtual Tree Grid

Thread ID:





633 Jul 18,2002 10:12 AM UTC Jul 18,2002 03:09 PM UTC WinForms 1
Tags: GridControl
Sebastien Lange
Asked On July 18, 2002 10:12 AM UTC

Hi, I'm implementing a grid that derive from the VirtTreeGrid. I'd like to resize the columns to fit. Normally I should use: gridControl1.ColWidths.ResizeToFit(GridRangeInfo.Col(1)); A solution could be to use the event QueryColWidth but how can I do that. If I use the ResizeToFit at this position, I get a StackOverflowException. Thanks, Sebastien

Clay Burch [Syncfusion]
Replied On July 18, 2002 03:09 PM UTC

You can remove the handler QueryColWidths and just let the grid store the colwidths for you. In this case, you would explicitly set the colwidths whenever you needed to do it. If you wanted it to be dynamic, autosizing a particular column using ResizeToFit, that should probably work. You might try it at the bottom of Form_Load after the data has been created and after the event handlers have been hooked. If you are trying to fit the cell with the indentation, you would have to increase the width by the max number of indents. You could call ResizeToFit, and then get the ColWidth of that column and increase it by extra space. You do not want to call a method like ResizeToFit from any of these Query... events as this is a fairly expensive call, and the query events can be hit often. And then you have the recursive call problem as well.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon