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

Hyperlink in header for numeric collumn

3 Answers 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lars
Top achievements
Rank 1
Lars asked on 05 Feb 2009, 09:10 PM

Hi all!
Is it at all possible to have a header collumn as a hyperlink for numeric columns? Examples appreciated
J

Cheers

3 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 06 Feb 2009, 04:43 AM
Hi Lars,

Try the following code snippet to add a HyperLink to the column header.

ASPX:
<telerik:GridNumericColumn UniqueName="EmployeeID" DataField="EmployeeID"></telerik:GridNumericColumn> 

CS:
protected void RadGrid1_PreRender(object sender, EventArgs e) 
    foreach (GridColumn col in RadGrid1.MasterTableView.RenderColumns) 
    { 
        if (col.UniqueName == "EmployeeID"
        { 
            foreach (GridHeaderItem headeritem in RadGrid1.MasterTableView.GetItems(GridItemType.Header)) 
            { 
                HyperLink hyplnk = new HyperLink(); 
                hyplnk.Text = "Redirect"
                hyplnk.NavigateUrl = "http://www.google.co.in/"
                headeritem["EmployeeID"].Controls.Add(hyplnk); 
            } 
        } 
    }   

Thanks,
Shinu.
0
Princy
Top achievements
Rank 2
answered on 06 Feb 2009, 08:14 AM
Hi Lars,

You can also refer the following help article which explains how to access cells and rows in Grid.
 Accessing cells and rows

Thanks
Princy
0
MANU
Top achievements
Rank 1
answered on 06 Feb 2009, 08:26 AM
Princy Molu,,,

Where r  u??  I am in Dubaii..............I really miss uuuuu.....

MANU
Tags
Grid
Asked by
Lars
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Princy
Top achievements
Rank 2
MANU
Top achievements
Rank 1
Share this question
or