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

Setting CSS class to a GridHyperLinkColumn or URL

1 Answer 308 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 30 Oct 2012, 06:19 PM
Good afternoon.

I am using Thickbox for modal windows and would like to continue using them with my web application.

The problem I am having is that Thickbox requires the class name "thickbox" to be used with a URL.  The problem I am having is the only way to set a class to a GridHyperLinkColumn is with the ItemStyle-CssClass which auctually sets the style to the li tag, not the href tag.

Is there any way to set the class to the URL that is generated with the GridHyperLinkColumn, or is there any other work around to do this?

Here is my current code:
<telerik:RadGrid width="900px" runat="server" ID="RadGrid2"  DataSourceID="DataSource1" OnItemCommand="RadGrid1_ItemCommand" Skin="Windows7">
 
    <MasterTableView AutoGenerateColumns="False" DataKeyNames="OwnerID" DataSourceID="DataSource1" CommandItemDisplay="Top"  EnableHeaderContextMenu="true">
    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True"></RowIndicatorColumn>
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True"></ExpandCollapseColumn>
 
            <telerik:GridBoundColumn DataField="KioskID" DataType="System.Int32" DefaultInsertValue="" FilterControlAltText="Filter KioskID column" HeaderText="KioskID" SortExpression="KioskID" UniqueName="KioskID"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="tranPaymentAmount" DataType="System.Single" DefaultInsertValue="" FilterControlAltText="Filter tranPaymentAmount column"  HeaderText="tranPaymentAmount" SortExpression="tranPaymentAmount" UniqueName="tranPaymentAmount"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CreationDate" DataType="System.DateTime"  FilterControlAltText="Filter CreationDate column" HeaderText="CreationDate" SortExpression="CreationDate" UniqueName="CreationDate"></telerik:GridBoundColumn>
 
        <telerik:GridHyperLinkColumn FooterText="HyperLinkColumn footer"
                DataTextFormatString="Customer info" DataNavigateUrlFields="AuthID" UniqueName="CustomerView"
                DataNavigateUrlFormatString="customer_edit.aspx?commandtype=edit&authid={0}&KeepThis=true&TB_iframe=true&height=550&width=600"
                HeaderText="Customer info" DataTextField="AuthID" AllowFiltering="False" Target="_blank">
            </telerik:GridHyperLinkColumn>
 
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 31 Oct 2012, 09:15 AM
Hi Kevin,

Try using the CSS as follows.

ASPX:
<telerik:GridHyperLinkColumn ItemStyle-CssClass="HyperStyle" FooterText="HyperLinkColumn footer" DataTextFormatString="Customer info" DataNavigateUrlFields="AuthID" UniqueName="CustomerView" DataNavigateUrlFormatString="customer_edit.aspx?commandtype=edit&authid={0}&KeepThis=true&TB_iframe=true&height=550&width=600" HeaderText="Customer info" DataTextField="AuthID" AllowFiltering="False" Target="_blank" ></telerik:GridHyperLinkColumn>

CSS:
<style type="text/css">
    .HyperStyle a
    {
        color: Red !important;
    }
</style>

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