This is a migrated thread and some comments may be shown as answers.

Setting Font Size After or Before Setting Data Source

3 Answers 92 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Robert Gouin
Top achievements
Rank 1
Robert Gouin asked on 16 Jul 2010, 08:44 PM
I am using Linq to fill a gridview like so...

Private Sub findCustomer(Optional ByVal s As String = Nothing)
        Dim cs = From c In cA.Select(False) Where _
                 IIf(IsNothing(s), 1 = 1, c.cLastName Like s & "*") _
                 Select New With _
                   { _
                     .Name = c.cLastName & ", " & c.cFirstName, _
                     .Phone = c.cPhoneHome & " / " & c.cPhoneWork, _
                     .DOB = c.cDateOfBirth _
                   }
        _totalCount = cs.Count
        _currentCount = 0
        loadCustomers()
    End Sub

and now all the information loads correctly and it looks fine, but no matter what I tweek or set, or change, the font on the records is always at 8 pts. and I would like it to be larger like around 14 pts.  Everything else on the grid view shows at 14, but the records that are loaded into it, are still small. 

How would I set that to a larger font?

3 Answers, 1 is accepted

Sort by
0
Svett
Telerik team
answered on 20 Jul 2010, 06:53 AM
Hi Robert Gouin,

You need to use the CellFormatting event to change the default font of the cells:

Font myFont = new Font("Arial", 25);
 
 void radGridView2_CellFormatting(object sender, CellFormattingEventArgs e)
 {
     e.CellElement.Font = myFont;
 }

You can read more about CellFormatting in this documentation article.

Also you need to set the AutoSizeRows property of RadGridView to true. This will enable the grid to automatically determine the height of its rows depending on their content.

All the best,
Svett
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Waleed Seada
Top achievements
Rank 2
answered on 05 Sep 2010, 11:08 AM
Hello,
How can I set an Arabic font for particular cells ?? Or how to tell radgrid to use a specific "script" for selected font.

Best regards
Waleed
0
Svett
Telerik team
answered on 08 Sep 2010, 05:56 PM
Hello Waleed Seada,

Please find the answer to your question in this forum Radgridview Tahoma font.

All the best,
Svett
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Robert Gouin
Top achievements
Rank 1
Answers by
Svett
Telerik team
Waleed Seada
Top achievements
Rank 2
Share this question
or