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.
Syncfusion Feedback

Minimum row height in GridDataControl

Thread ID:

Created:

Updated:

Platform:

Replies:

101186 Oct 4,2011 07:34 PM UTC Nov 3,2011 08:53 AM UTC WPF 3
loading
Tags: GridControl
Mary Fontana
Asked On October 4, 2011 07:34 PM UTC

I am using GridDataVisibleColumn to create the columns in my grid and I set the minimum width of each column by using
gridDataVisibleColumn's MinimumWidth.


Is there a way to set the minimum height of the rows in gridDataControl?



Rajasekar [Syncfusion]
Replied On October 6, 2011 11:08 AM UTC

Hi Mary,

Thanks for your update, You can achieve your requirement by setting the below properties,

Code Snippet[C#]

this.dataGrid.DefaultHeaderRowHeight = 50;
this.dataGrid.Model.RowHeights.DefaultLineSize = 50;

Please let us know if you have any queries.

Thanks,
Rajasekar



Mary Fontana
Replied On October 11, 2011 08:11 PM UTC

But setting

this.dataGrid.DefaultHeaderRowHeight = 50;
this.dataGrid.Model.RowHeights.DefaultLineSize = 50;

doesnt set a minimum height.

The problem I have is that if I allow a user can hide a row. Then there is no way to get the row back.
So I was thinking I could give a minimum row height of for example 2.
So that the hidden row will still have height of 2 and can be expanded if the user double clicks on it.

A similar issue is when a user hides a column.
I give it a minimum column width of 2. And part of the column is still visible so that it can be expanded if user double clicks on it.

in documentation
section 4.1.3.7 I say this
this.gridControl.Model.HiddenBorderBrush = Brushes.Red ;
this.gridControl.Model.HiddenBorderThikness = 3;

But I could not find these properties in GridDataControl.





Rajasekar [Syncfusion]
Replied On November 3, 2011 08:53 AM UTC

Hi Mary,

You can achieve your requirement by using the below code snippet,

Code Snippet[C#]

dataGrid1.ResizingColumns += new GridResizingColumnsEventHandler(dataGrid1_ResizingColumns);
dataGrid1.ResizingRows += new GridResizingRowsEventHandler(dataGrid1_ResizingRows);

void dataGrid1_ResizingRows(object sender, GridResizingRowsEventArgs args)
{
if (args.Height < 10)
{
this.dataGrid1.Model.RowHeights[args.Rows.Top] = 10;
args.AllowResize = false;
}
}

void dataGrid1_ResizingColumns(object sender, GridResizingColumnsEventArgs args)
{
if (args.Width < 5)
args.Width = 5;
}

Please let us know if you have any queries.

Thanks,
Rajasekar




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

;