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.

Set Font on GridListControl

Thread ID:

Created:

Updated:

Platform:

Replies:

51675 Nov 10,2006 10:22 AM Nov 14,2006 02:20 PM Windows Forms 6
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On November 10, 2006 10:22 AM

I tried to set Font on GridListControl.Font and GridListControl.Grid.Font, but it doesn't seem to work.

Can someone please tell me how to change the font on a GridListControl?

Thanks,

Frank

Administrator [Syncfusion]
Replied On November 10, 2006 12:47 PM

Try code like

Me.GridListControl1.Grid.BaseStylesMap("Standard").StyleInfo.Font = New Syncfusion.Windows.Forms.Grid.GridFontInfo(New Font("Arial", 18))

to see if that does what you want.

Administrator [Syncfusion]
Replied On November 10, 2006 06:24 PM

Thanks. That works.

Can you also tell me how to set the row height for all the rows? I tried to set ItemHeight, but it doesn't work.

I'm using version 4.2.0.60.

Thanks again,

Frank

Administrator [Syncfusion]
Replied On November 12, 2006 11:41 PM

Hi Frank,

Use the Grid.DefaultRowHeight property to set the row height of the GridListControl. Here is a code snippet

Me.gridListControl1.Grid.DefaultRowHeight = 50

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On November 13, 2006 08:59 AM

Haneef,
Thanks for your replay. Unfortunately it didn't work. Any other suggestions?
I found out it's due to the fact that I bind the gridlistcontrol to a datatable. If the gridlistcontrol is unbound, i can just set the ItemHeight directly on gridlistcontrol and it will work. Is it a bug?
Thanks,
Frank

Administrator [Syncfusion]
Replied On November 13, 2006 11:37 PM

Hi Frank,

To set the RowHeight of the GridListControl,
You need to handle the Grid.Model.QueryRowHeight event. Here is a code snippet

//form Load...
this.gridListControl1.Grid.Model.QueryRowHeight +=new GridRowColSizeEventHandler(Model_QueryRowHeight);

private void Model_QueryRowHeight(object sender, GridRowColSizeEventArgs e)
{
e.Size = 100;
e.Handled = true;
}

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/GRIdListControlRowHeight_bc37df09.zip

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On November 14, 2006 02:20 PM

Cool. Works like a charm. Thanks.
Frank

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.

;