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

GridHyperLinkColumn Formatting

1 Answer 195 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Garry
Top achievements
Rank 1
Garry asked on 03 Jul 2008, 08:56 AM

Hi,

I have a RadGrid with a HyperLinkColumn which I want formatted as blue with no text decoration (i.e. no underline).

I have tried:

<
telerik:GridHyperLinkColumn HeaderText="A" UniqueName="B" Text="C" DataNavigateUrlFormatString="D.aspx?Reference={0}" DataNavigateUrlFields="E" ItemStyle-ForeColor="Blue" ItemStyle-Font-Underline="false">
<ItemStyle HorizontalAlign="Left" />
</telerik:GridHyperLinkColumn>

I have also tried:

<

telerik:GridHyperLinkColumn HeaderText="A" UniqueName="B" Text="C" DataNavigateUrlFormatString="D.aspx?Reference={0}" DataNavigateUrlFields="E">
<ItemStyle ForeColor="Blue" />
</telerik:GridHyperLinkColumn>


Is there anything additional to the above that needs to be set in order to make these properties take effect?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Jul 2008, 10:47 AM
Hi Stylli,

Can you try setting it in the code behind as shown below.


ASPX:
<telerik:GridHyperLinkColumn HeaderText="HyperCol" NavigateUrl="~/Default5.aspx"  UniqueName="HyperCol" DataTextField="DataType"  > 
                     </telerik:GridHyperLinkColumn> 

CS:
 
    protected void RadGrid2_PreRender(object sender, EventArgs e) 
    { 
        foreach (GridColumn col in RadGrid2.MasterTableView.RenderColumns) 
        { 
            if (col.ColumnType == "GridHyperLinkColumn") 
            { 
                GridHyperLinkColumn hypcol = (GridHyperLinkColumn)col; 
                if (hypcol.UniqueName == "HyperCol") 
                { 
                    hypcol.ItemStyle.Font.Underline = false
                } 
            } 
        } 
    } 


Thanks
Shinu.
Tags
Grid
Asked by
Garry
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or