We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to disable URL underline

I am using virtual virtual grid. I observed that default cells underline hyperlinks. How do I disable hyperlink detection? I am using Syncfusion 2.1.0.9

3 Replies

AD Administrator Syncfusion Team February 15, 2005 06:49 PM UTC

By default, the grid uses a RichTextBox for editing. It is this control that is underlining the link. Try this setting: this.gridDataBoundGrid1.TableStyle.CellType = "OriginalTextBox"; It sets the grid to default to a TextBox control for editing.


IS Ichiro Sugimoto June 13, 2007 09:59 AM UTC

I can disable blue underline in Textbox cell by changing celltype to "OriginalTextBox", indeed.
Then, How can I do for Combobox cell, whose DropDownStyle is Editable?
(I cannot find celltype "OriginalCombobox"...)

>By default, the grid uses a RichTextBox for editing. It is this control that is underlining the link.
>
>Try this setting:
>
>this.gridDataBoundGrid1.TableStyle.CellType = "OriginalTextBox";
>

>
>It sets the grid to default to a TextBox control for editing.


HA haneefm Syncfusion Team June 13, 2007 06:54 PM UTC

Hi Sugimoto,

You can handle the CurrentCellControlGotFocus event and set the DetectUrls property of the RichTextBox control to false. Here is a code snippet.

private void gridDataBoundGrid1_CurrentCellControlGotFocus(object sender, System.Windows.Forms.ControlEventArgs e)
{
RichTextBox RTB = e.Control as RichTextBox;
if( RTB != null )
{
RTB.DetectUrls = false;
}
}

If you want to change the underlying style of the richtextbox then you need to import the "user32.dll" and call the sendMessage method. Here is a minimal sample that shows you "How to set underlying style in a RichTextControl?".

Sample :GDBGUnderlineStyle.zip

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon