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

Clickable GridBoundColumn cells

1 Answer 112 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Justin Jones
Top achievements
Rank 1
Justin Jones asked on 02 Sep 2008, 02:42 PM
Hi there,

Is there a way to have hyperlinks for GridBoundColumn cells?
I need to use Aggregate and FooterAggregateFormatString attributes for GridBoundColumn, but I also need to make the cells clickable as GridHyperLinkColumns

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Sep 2008, 04:57 AM
Hi Justin,

One suggestion is to add HyperLink in each cell of the corresponding column in the code behind.

CS:
 protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem item = (GridDataItem)e.Item; 
            HyperLink hyplink = new HyperLink(); 
            hyplink.ID = "HyperLink1"
            hyplink.Text = item["columnUniqueName"].Text; 
            hyplink.NavigateUrl = "http://www.google.co.in/"
            item["FirstName"].Controls.Add(hyplink); 
 
        }  
   } 


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