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

Formating a cell value with underline in TextboxColumn of RadGridview

2 Answers 556 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Cao Trí
Top achievements
Rank 1
Cao Trí asked on 16 Sep 2016, 02:43 AM

Hi all,

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

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 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 20 Sep 2016, 11:03 AM
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.
0
Cao Trí
Top achievements
Rank 1
answered on 21 Sep 2016, 04:44 AM

It works fine. Thank Dess :)

Best,

Tri Nguyen

Tags
GridView
Asked by
Cao Trí
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Cao Trí
Top achievements
Rank 1
Share this question
or