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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Programatically changing the height of the grid control?

Thread ID:

Created:

Updated:

Platform:

Replies:

10762 Feb 11,2004 06:56 PM UTC Feb 11,2004 10:01 PM UTC WinForms 2
loading
Tags: GridControl
Mark Hoffman
Asked On February 11, 2004 06:56 PM UTC

I need to be able to have my grid control be sized so it precisely fits X amount of rows. My trouble is, how do I know how height my control should be? I first tried something like this: for (int i=1;i

Administrator [Syncfusion]
Replied On February 11, 2004 07:41 PM UTC

A couple of comments. You need to start your loop from 0 and not 1. Row 0 is the Columns headers, so you need to account for that as well unless they are hidden. (The header row is little taller by default than the othe rrows). You can use the method grid.Model.RowHeights.GetTotal to sum up row heights. You can set the backcolor of the grid''s client area that is not occupied by cells (the gray part you mentioned) by setting grid.Properties.BackgroundColor.

Mark Hoffman
Replied On February 11, 2004 10:01 PM UTC

Perfect! Thanks! >A couple of comments. You need to start your loop from 0 and not 1. Row 0 is the Columns headers, so you need to account for that as well unless they are hidden. (The header row is little taller by default than the othe rrows). > >You can use the method grid.Model.RowHeights.GetTotal to sum up row heights. > >You can set the backcolor of the grid''s client area that is not occupied by cells (the gray part you mentioned) by setting grid.Properties.BackgroundColor. >

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

;