Setting Font Size After or Before Setting Data Source

4 posts, 0 answers
  1. Robert Gouin
    Robert  Gouin avatar
    11 posts
    Member since:
    Oct 2009

    Posted 16 Jul 2010 Link to this post

    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?
  2. Svett
    Admin
    Svett avatar
    728 posts

    Posted 20 Jul 2010 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Waleed Seada
    Waleed Seada avatar
    241 posts
    Member since:
    May 2006

    Posted 05 Sep 2010 Link to this post

    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
  5. Svett
    Admin
    Svett avatar
    728 posts

    Posted 08 Sep 2010 Link to this post

    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
Back to Top