Set Font on GridListControl

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

6 Replies

AD Administrator Syncfusion Team November 10, 2006 05:47 PM UTC

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.


AD Administrator Syncfusion Team November 10, 2006 11:24 PM UTC

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


AD Administrator Syncfusion Team November 13, 2006 04:41 AM UTC

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


AD Administrator Syncfusion Team November 13, 2006 01:59 PM UTC

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


AD Administrator Syncfusion Team November 14, 2006 04:37 AM UTC

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


AD Administrator Syncfusion Team November 14, 2006 07:20 PM UTC

Cool. Works like a charm. Thanks.
Frank

Loader.
Up arrow icon