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

Display Width vs grid.width

Thread ID:





1172 Sep 30,2002 08:55 PM UTC Sep 30,2002 10:39 PM UTC WinForms 1
Tags: GridControl
Anthony Mansfield
Asked On September 30, 2002 08:55 PM UTC

Is there a way to calculate the amount of width that is required to display all of the bound columns in a grid? I have a Search screen that displays different columns depending on the search. Rather than scrolling, it would be nice if I could calculate the dispaly width and size the form to accomodate the columns without forcing the user to scroll. Based on my past inquiries, I imagine there is a way to do this. Thanks in advance. Anthony

Stefan Hoenig [Syncfusion]
Replied On September 30, 2002 10:39 PM UTC

You should be able to just call grid.Model.ColWidths.GetTotal(0, grid.Model.ColCount) plus add 2 pixels space for borders. Maybe 4. I haven't tested it... Stefan


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