Formating a cell value with underline in TextboxColumn of RadGridview

3 posts, 0 answers
  1. Cao Trí
    Cao Trí avatar
    2 posts
    Member since:
    Aug 2016

    Posted 15 Sep Link to this post

    Hi all,

    Can I format a cell value with underline in textbox column of a gridview.

    According to this link, http://docs.telerik.com/devtools/winforms/gridview/cells/formatting-cells, only 4 style properties can be set:

    Fill
    Border
    Font
    ForeColor

    Best,

    Tri Nguyen

     

  2. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 20 Sep Link to this post

    Hello ,

    Thank you for writing.  

    In order to make the cell's text underlined, it is suitable to use the HTML-like text formatting functionality. Here is a sample code snippet which result is illustrated on the attached screenshot:
     
    private void radGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
    {
        if (e.Column.Name == "ContactName")
        {
            e.CellElement.DisableHTMLRendering = false;
            e.CellElement.Text = "<html><u>" + e.CellElement.Value ;
        }
    }

    I hope this information helps. Should you have further questions I would be glad to help.

    Regards,
    Dess
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Cao Trí
    Cao Trí avatar
    2 posts
    Member since:
    Aug 2016

    Posted 20 Sep in reply to Dess Link to this post

    It works fine. Thank Dess :)

    Best,

    Tri Nguyen

Back to Top