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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to catch row/column resize ?

Thread ID:

Created:

Updated:

Platform:

Replies:

88811 Aug 12,2009 03:34 PM UTC Aug 19,2009 11:48 AM UTC WPF 5
loading
Tags: GridControl
Nazim YENIER
Asked On August 12, 2009 03:34 PM UTC

Hi,

In an Essential Grid,
the total width of all the columns is independent from the width of the grid itself. It can be smaller or larger.

It's the same for the total height of all the rows.

I am resizing row/column sizes using frozen rows/columns. I need to catch the row/column resize event in order to adjust the general size of the grid to the total size of all columns.

Example:

private void MyGridRowResize() // Event called when a row is resized
{
MyGrid.Height = TotalHeightOfAllTheRows;
}

How can I accomplish this ?

Thanks in advance

Nazim YENIER



Clay Burch [Syncfusion]
Replied On August 13, 2009 02:47 PM UTC

If I understand what you are asking, I think you can use the GridControl.Model.ColumnWidths.LineSizeChanged event (& RowHeights.LineSizedChanged event) to adjust the grid's width and height as your user changes a column width or row height. Here is a little sample.



WpfApplication17_9e0a6bda.zip

Nazim YENIER
Replied On August 14, 2009 08:28 AM UTC

Hi,
This is almost exactly what I wanted with a little problem:

'LineSizeChanged' fires only when the mouse button is released, not before. So the user can't see the grid changing size while dragging.

What I need is something like :
'LineSizeIsBeingChanged'

I need to adjust the grid general size as the user is moving his mouse to change the row/column size.

Clay Burch [Syncfusion]
Replied On August 14, 2009 12:51 PM UTC

If you only want to catch the action of your user changing rowheights/columnwidths through the UI, then you can use this event instead of the LineSized event.

gridControl1.ResizingRows += new GridResizingRowsEventHandler(gridControl1_ResizingRows);



void gridControl1_ResizingRows(object sender, GridResizingRowsEventArgs args)
{
if (args.Reason == GridResizeCellsReason.MouseMove)
{
SizeGridToFitRowsAndColumns();
}
}


There is also a ResizingColumns even that you can use for the columns as well.

Nazim YENIER
Replied On August 17, 2009 02:54 PM UTC

Excellent !
Works great, thanks.

Nazim YENIER

Mohamed Suhaib Fahad A. [Syncfusion]
Replied On August 19, 2009 11:48 AM UTC

Hi Nazim,

Thanks for your feedbacks. We are glad that you got it working.

Thanks,
Fahad
Grid.WPF Team
Syncfusion Inc.,

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

;