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.

Resizing column heights with GridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

66781 Aug 2,2007 07:23 AM Aug 3,2007 10:38 AM Windows Forms 4
loading
Tags: GridControl
Ben Fisher
Asked On August 2, 2007 07:23 AM

Hi,

I've got custom grid implementation using the GridControl based on the RepeaterUserControlSample code.

I want to improve it so that my user control which is used to edit row data can change it's height according to data that is entered.

Specifically, the user will make changes to the row data through the user control which will cause the user control to increase or descrease in height. I then was the grid row to resize accordingly.

What is the easiest way to do this? I've tried using RowHeights.ResizeToFit, but it doesn't seem to work in this situation (it's always resizes far too small).

Thanks in advance,

Ben.

Rajagopal [Syncfusion]
Replied On August 2, 2007 11:53 AM

Hi Ben,

If you want to autosize the rowheight as the user enters data inside the cell, then please try the below property settings that will help you in doing this.

this.gridControl1.TableStyle.WrapText = true;
this.gridControl1.TableStyle.AutoSize = true;

Let me know if you have any other questions.

Have a nice time.
Regards,
Rajagopal

Ben Fisher
Replied On August 3, 2007 05:59 AM

Hi,

The fix you suggests has no effect.

As I stated in the first post I have implemented a grid based on the RepeaterUserControlSample. This means I implement my own binding and use a custom user control to display and handle the editing of the data.

I want to be able to adjust the height of my custom user control and also the height of the row based on a particular user action.

I have tried calling RowHeights.SetSize(). This allows me to adjust the row height, but causes other problems.

If for example I have three rows. If I increase the height of the first row by 50% the height of the 3rd row decreases by 50%. It seems that although I can increase the row height of an individual row, the accumulated height of all the rows remains the same, so rows are effectively being pushed off (squahsed up against) the end of the grid.

Please could you suggest a fix for this.

I recommend looking at the sample I mentioned before replying again.

Thanks,

Ben.


>Hi Ben,

If you want to autosize the rowheight as the user enters data inside the cell, then please try the below property settings that will help you in doing this.

this.gridControl1.TableStyle.WrapText = true;
this.gridControl1.TableStyle.AutoSize = true;

Let me know if you have any other questions.

Have a nice time.
Regards,
Rajagopal

Ben Fisher
Replied On August 3, 2007 10:23 AM

Hi, i've now got a bit more information about the problem.

It seems that the problem may be with the scroll bars. They just don't seem to readjust to take into account the increase in row height.

That actual problem once I've changed the row height seems to simply be that I can not scroll any further than I could before changing the height.

This effectively means rows at the end of the grid cannot be reached.

Does anyone have any ideas as to how i can reset the scroll bars somehow

Ben Fisher
Replied On August 3, 2007 10:38 AM

Ah... I found it.

You can use GridControl.UpdateScrollBars to get the grid to recalculate how much scrolling the scrollbars will allow.


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.

;